diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -38,9 +38,14 @@ IF(HAVE_LP) ADD_EXECUTABLE(lp_test lp_test.cc) + SET(LP_TEST_LIBS lemon) IF(HAVE_GLPK) - TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES}) + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) ENDIF(HAVE_GLPK) + IF(HAVE_CPLEX) + SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES}) + ENDIF(HAVE_CPLEX) + TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) ADD_TEST(lp_test lp_test) IF(WIN32 AND HAVE_GLPK) @@ -52,13 +57,25 @@ COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ) ENDIF(WIN32 AND HAVE_GLPK) + IF(WIN32 AND 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} + ) + ENDIF(WIN32 AND HAVE_CPLEX) ENDIF(HAVE_LP) IF(HAVE_MIP) ADD_EXECUTABLE(mip_test mip_test.cc) + SET(MIP_TEST_LIBS lemon) IF(HAVE_GLPK) - TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES}) + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) ENDIF(HAVE_GLPK) + IF(HAVE_CPLEX) + SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) + ENDIF(HAVE_CPLEX) + TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) ADD_TEST(mip_test mip_test) IF(WIN32 AND HAVE_GLPK) @@ -70,6 +87,13 @@ COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ) ENDIF(WIN32 AND HAVE_GLPK) + IF(WIN32 AND 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} + ) + ENDIF(WIN32 AND HAVE_CPLEX) ENDIF(HAVE_MIP) FOREACH(TEST_NAME ${TESTS})