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.")
37 min_cost_arborescence_test
49 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
50 ADD_EXECUTABLE(lp_test lp_test.cc)
52 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
55 SET(LP_TEST_LIBS lemon)
58 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
61 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
64 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
67 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
68 ADD_TEST(lp_test lp_test)
69 ADD_DEPENDENCIES(check lp_test)
71 IF(WIN32 AND LEMON_HAVE_GLPK)
72 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
73 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
74 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
75 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
76 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
77 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
81 IF(WIN32 AND LEMON_HAVE_CPLEX)
82 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
83 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
84 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
85 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
91 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
92 ADD_EXECUTABLE(mip_test mip_test.cc)
94 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
97 SET(MIP_TEST_LIBS lemon)
100 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
103 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
106 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
109 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
110 ADD_TEST(mip_test mip_test)
111 ADD_DEPENDENCIES(check mip_test)
113 IF(WIN32 AND LEMON_HAVE_GLPK)
114 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
115 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
116 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
117 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
118 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
119 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
123 IF(WIN32 AND LEMON_HAVE_CPLEX)
124 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
125 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
126 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
127 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
132 FOREACH(TEST_NAME ${TESTS})
133 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
134 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
136 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
138 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
139 IF(TEST_WITH_VALGRIND)
140 ADD_TEST(${TEST_NAME}
141 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
142 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
144 ADD_TEST(${TEST_NAME} ${TEST_NAME})
146 ADD_DEPENDENCIES(check ${TEST_NAME})