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.")
38 min_cost_arborescence_test
50 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
51 ADD_EXECUTABLE(lp_test lp_test.cc)
53 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
56 SET(LP_TEST_LIBS lemon)
59 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
62 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
65 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
68 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
69 ADD_TEST(lp_test lp_test)
70 ADD_DEPENDENCIES(check lp_test)
72 IF(WIN32 AND LEMON_HAVE_GLPK)
73 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
74 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
75 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
76 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
77 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
78 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
82 IF(WIN32 AND LEMON_HAVE_CPLEX)
83 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
84 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
85 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
86 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
92 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
93 ADD_EXECUTABLE(mip_test mip_test.cc)
95 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
98 SET(MIP_TEST_LIBS lemon)
101 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
104 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
107 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
110 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
111 ADD_TEST(mip_test mip_test)
112 ADD_DEPENDENCIES(check mip_test)
114 IF(WIN32 AND LEMON_HAVE_GLPK)
115 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
116 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
117 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
118 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
119 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
120 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
124 IF(WIN32 AND LEMON_HAVE_CPLEX)
125 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
126 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
127 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
128 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
133 FOREACH(TEST_NAME ${TESTS})
134 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
135 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
137 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
139 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
140 IF(TEST_WITH_VALGRIND)
141 ADD_TEST(${TEST_NAME}
142 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
143 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
145 ADD_TEST(${TEST_NAME} ${TEST_NAME})
147 ADD_DEPENDENCIES(check ${TEST_NAME})