test/CMakeLists.txt
branch1.1
changeset 848 f1909b4c38d6
parent 696 76cbcb3e9bbb
child 745 f9746e45246e
child 810 93cd93e82f9b
child 1033 16d466589b54
     1.1 --- a/test/CMakeLists.txt	Thu May 28 16:59:51 2009 +0100
     1.2 +++ b/test/CMakeLists.txt	Mon Jun 01 17:49:43 2009 +0100
     1.3 @@ -3,7 +3,9 @@
     1.4    ${PROJECT_BINARY_DIR}
     1.5  )
     1.6  
     1.7 -LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
     1.8 +LINK_DIRECTORIES(
     1.9 +  ${PROJECT_BINARY_DIR}/lemon
    1.10 +)
    1.11  
    1.12  SET(TESTS
    1.13    adaptors_test
    1.14 @@ -35,20 +37,23 @@
    1.15    random_test
    1.16    suurballe_test
    1.17    time_measure_test
    1.18 -  unionfind_test)
    1.19 +  unionfind_test
    1.20 +)
    1.21  
    1.22  IF(LEMON_HAVE_LP)
    1.23    ADD_EXECUTABLE(lp_test lp_test.cc)
    1.24    SET(LP_TEST_LIBS lemon)
    1.25 +
    1.26    IF(LEMON_HAVE_GLPK)
    1.27      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
    1.28 -  ENDIF(LEMON_HAVE_GLPK)
    1.29 +  ENDIF()
    1.30    IF(LEMON_HAVE_CPLEX)
    1.31      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
    1.32 -  ENDIF(LEMON_HAVE_CPLEX)
    1.33 +  ENDIF()
    1.34    IF(LEMON_HAVE_CLP)
    1.35      SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
    1.36 -  ENDIF(LEMON_HAVE_CLP)
    1.37 +  ENDIF()
    1.38 +
    1.39    TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    1.40    ADD_TEST(lp_test lp_test)
    1.41  
    1.42 @@ -56,32 +61,35 @@
    1.43      GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    1.44      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    1.45      ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    1.46 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    1.47 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    1.48 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    1.49 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    1.50 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    1.51 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    1.52      )
    1.53 -  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
    1.54 +  ENDIF()
    1.55 +
    1.56    IF(WIN32 AND LEMON_HAVE_CPLEX)
    1.57      GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
    1.58      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    1.59      ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
    1.60 -      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    1.61 +      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
    1.62      )
    1.63 -  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
    1.64 -ENDIF(LEMON_HAVE_LP)
    1.65 +  ENDIF()
    1.66 +ENDIF()
    1.67  
    1.68  IF(LEMON_HAVE_MIP)
    1.69    ADD_EXECUTABLE(mip_test mip_test.cc)
    1.70    SET(MIP_TEST_LIBS lemon)
    1.71 +
    1.72    IF(LEMON_HAVE_GLPK)
    1.73      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
    1.74 -  ENDIF(LEMON_HAVE_GLPK)
    1.75 +  ENDIF()
    1.76    IF(LEMON_HAVE_CPLEX)
    1.77      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
    1.78 -  ENDIF(LEMON_HAVE_CPLEX)
    1.79 +  ENDIF()
    1.80    IF(LEMON_HAVE_CBC)
    1.81      SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
    1.82 -  ENDIF(LEMON_HAVE_CBC)
    1.83 +  ENDIF()
    1.84 +
    1.85    TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    1.86    ADD_TEST(mip_test mip_test)
    1.87  
    1.88 @@ -89,22 +97,23 @@
    1.89      GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
    1.90      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
    1.91      ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
    1.92 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    1.93 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    1.94 -      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    1.95 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
    1.96 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
    1.97 +      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
    1.98      )
    1.99 -  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
   1.100 +  ENDIF()
   1.101 +
   1.102    IF(WIN32 AND LEMON_HAVE_CPLEX)
   1.103      GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
   1.104      GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
   1.105      ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
   1.106 -      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   1.107 +      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
   1.108      )
   1.109 -  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
   1.110 -ENDIF(LEMON_HAVE_MIP)
   1.111 +  ENDIF()
   1.112 +ENDIF()
   1.113  
   1.114  FOREACH(TEST_NAME ${TESTS})
   1.115    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
   1.116    TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
   1.117    ADD_TEST(${TEST_NAME} ${TEST_NAME})
   1.118 -ENDFOREACH(TEST_NAME)
   1.119 +ENDFOREACH()