7 ${PROJECT_BINARY_DIR}/lemon
10 SET(TEST_WITH_VALGRIND "NO" CACHE STRING
11 "Run the test with valgrind (YES/NO).")
12 SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
36 min_cost_arborescence_test
48 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
49 ADD_EXECUTABLE(lp_test lp_test.cc)
51 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
54 SET(LP_TEST_LIBS lemon)
57 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
60 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
63 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
66 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
67 ADD_TEST(lp_test lp_test)
69 IF(WIN32 AND LEMON_HAVE_GLPK)
70 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
71 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
72 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
73 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
74 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
75 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
79 IF(WIN32 AND LEMON_HAVE_CPLEX)
80 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
81 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
82 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
83 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
89 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
90 ADD_EXECUTABLE(mip_test mip_test.cc)
92 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
95 SET(MIP_TEST_LIBS lemon)
98 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
101 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
104 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
107 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
108 ADD_TEST(mip_test mip_test)
110 IF(WIN32 AND LEMON_HAVE_GLPK)
111 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
112 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
113 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
114 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
115 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
116 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
120 IF(WIN32 AND LEMON_HAVE_CPLEX)
121 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
122 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
123 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
124 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
129 FOREACH(TEST_NAME ${TESTS})
130 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
131 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
133 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
135 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
136 IF(TEST_WITH_VALGRIND)
137 ADD_TEST(${TEST_NAME}
138 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
139 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
141 ADD_TEST(${TEST_NAME} ${TEST_NAME})
143 ADD_DEPENDENCIES(check ${TEST_NAME})