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.")
30 fractional_matching_test
41 max_cardinality_search_test
43 min_cost_arborescence_test
46 nagamochi_ibaraki_test
58 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
59 ADD_EXECUTABLE(lp_test lp_test.cc)
61 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
64 SET(LP_TEST_LIBS lemon)
67 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
70 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
73 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
76 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
77 ADD_TEST(lp_test lp_test)
78 ADD_DEPENDENCIES(check lp_test)
80 IF(WIN32 AND LEMON_HAVE_GLPK)
81 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
82 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
83 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
84 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
85 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
86 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
90 IF(WIN32 AND LEMON_HAVE_CPLEX)
91 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
92 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
93 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
94 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
100 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
101 ADD_EXECUTABLE(mip_test mip_test.cc)
103 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
106 SET(MIP_TEST_LIBS lemon)
109 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
112 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
115 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
118 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
119 ADD_TEST(mip_test mip_test)
120 ADD_DEPENDENCIES(check mip_test)
122 IF(WIN32 AND LEMON_HAVE_GLPK)
123 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
124 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
125 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
126 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
127 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
128 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
132 IF(WIN32 AND LEMON_HAVE_CPLEX)
133 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
134 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
135 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
136 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
141 FOREACH(TEST_NAME ${TESTS})
142 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
143 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
145 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
147 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
148 IF(TEST_WITH_VALGRIND)
149 ADD_TEST(${TEST_NAME}
150 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
151 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
153 ADD_TEST(${TEST_NAME} ${TEST_NAME})
155 ADD_DEPENDENCIES(check ${TEST_NAME})