1.1 --- a/test/CMakeLists.txt Sat Apr 25 02:12:41 2009 +0200
1.2 +++ b/test/CMakeLists.txt Sat Apr 25 17:51:09 2009 +0100
1.3 @@ -3,10 +3,6 @@
1.4 ${PROJECT_BINARY_DIR}
1.5 )
1.6
1.7 -IF(HAVE_GLPK)
1.8 - INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
1.9 -ENDIF(HAVE_GLPK)
1.10 -
1.11 LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
1.12
1.13 SET(TESTS
1.14 @@ -42,9 +38,17 @@
1.15
1.16 IF(HAVE_LP)
1.17 ADD_EXECUTABLE(lp_test lp_test.cc)
1.18 + SET(LP_TEST_LIBS lemon)
1.19 IF(HAVE_GLPK)
1.20 - TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
1.21 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
1.22 ENDIF(HAVE_GLPK)
1.23 + IF(HAVE_CPLEX)
1.24 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
1.25 + ENDIF(HAVE_CPLEX)
1.26 + IF(HAVE_CLP)
1.27 + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
1.28 + ENDIF(HAVE_CLP)
1.29 + TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
1.30 ADD_TEST(lp_test lp_test)
1.31
1.32 IF(WIN32 AND HAVE_GLPK)
1.33 @@ -56,13 +60,28 @@
1.34 COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
1.35 )
1.36 ENDIF(WIN32 AND HAVE_GLPK)
1.37 + IF(WIN32 AND HAVE_CPLEX)
1.38 + GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
1.39 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.40 + ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
1.41 + COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
1.42 + )
1.43 + ENDIF(WIN32 AND HAVE_CPLEX)
1.44 ENDIF(HAVE_LP)
1.45
1.46 IF(HAVE_MIP)
1.47 ADD_EXECUTABLE(mip_test mip_test.cc)
1.48 + SET(MIP_TEST_LIBS lemon)
1.49 IF(HAVE_GLPK)
1.50 - TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
1.51 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
1.52 ENDIF(HAVE_GLPK)
1.53 + IF(HAVE_CPLEX)
1.54 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
1.55 + ENDIF(HAVE_CPLEX)
1.56 + IF(HAVE_CBC)
1.57 + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
1.58 + ENDIF(HAVE_CBC)
1.59 + TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
1.60 ADD_TEST(mip_test mip_test)
1.61
1.62 IF(WIN32 AND HAVE_GLPK)
1.63 @@ -74,6 +93,13 @@
1.64 COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
1.65 )
1.66 ENDIF(WIN32 AND HAVE_GLPK)
1.67 + IF(WIN32 AND HAVE_CPLEX)
1.68 + GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
1.69 + GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
1.70 + ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
1.71 + COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
1.72 + )
1.73 + ENDIF(WIN32 AND HAVE_CPLEX)
1.74 ENDIF(HAVE_MIP)
1.75
1.76 FOREACH(TEST_NAME ${TESTS})