diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,7 +3,9 @@ ${PROJECT_BINARY_DIR} ) -LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) +LINK_DIRECTORIES( + ${PROJECT_BINARY_DIR}/lemon +) SET(TESTS adaptors_test @@ -35,20 +37,23 @@ random_test suurballe_test time_measure_test - unionfind_test) + unionfind_test +) IF(LEMON_HAVE_LP) ADD_EXECUTABLE(lp_test lp_test.cc) SET(LP_TEST_LIBS lemon) + IF(LEMON_HAVE_GLPK) SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) - ENDIF(LEMON_HAVE_GLPK) + ENDIF() IF(LEMON_HAVE_CPLEX) SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES}) - ENDIF(LEMON_HAVE_CPLEX) + ENDIF() IF(LEMON_HAVE_CLP) SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) - ENDIF(LEMON_HAVE_CLP) + ENDIF() + TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) ADD_TEST(lp_test lp_test) @@ -56,32 +61,35 @@ GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD - COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} - COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} - COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ) - ENDIF(WIN32 AND LEMON_HAVE_GLPK) + ENDIF() + IF(WIN32 AND LEMON_HAVE_CPLEX) GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD - COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} ) - ENDIF(WIN32 AND LEMON_HAVE_CPLEX) -ENDIF(LEMON_HAVE_LP) + ENDIF() +ENDIF() IF(LEMON_HAVE_MIP) ADD_EXECUTABLE(mip_test mip_test.cc) SET(MIP_TEST_LIBS lemon) + IF(LEMON_HAVE_GLPK) SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) - ENDIF(LEMON_HAVE_GLPK) + ENDIF() IF(LEMON_HAVE_CPLEX) SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) - ENDIF(LEMON_HAVE_CPLEX) + ENDIF() IF(LEMON_HAVE_CBC) SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) - ENDIF(LEMON_HAVE_CBC) + ENDIF() + TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) ADD_TEST(mip_test mip_test) @@ -89,22 +97,23 @@ GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD - COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} - COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} - COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ) - ENDIF(WIN32 AND LEMON_HAVE_GLPK) + ENDIF() + IF(WIN32 AND LEMON_HAVE_CPLEX) GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD - COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH} ) - ENDIF(WIN32 AND LEMON_HAVE_CPLEX) -ENDIF(LEMON_HAVE_MIP) + ENDIF() +ENDIF() FOREACH(TEST_NAME ${TESTS}) ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) ADD_TEST(${TEST_NAME} ${TEST_NAME}) -ENDFOREACH(TEST_NAME) +ENDFOREACH()