ladanyi@510: INCLUDE_DIRECTORIES( ladanyi@549: ${PROJECT_SOURCE_DIR} ladanyi@510: ${PROJECT_BINARY_DIR} ladanyi@510: ) ladanyi@141: ladanyi@679: LINK_DIRECTORIES( ladanyi@679: ${PROJECT_BINARY_DIR}/lemon ladanyi@679: ) ladanyi@510: alpar@933: SET(TEST_WITH_VALGRIND "NO" CACHE STRING alpar@933: "Run the test with valgrind (YES/NO).") alpar@933: SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") ladanyi@141: alpar@225: SET(TESTS deba@488: adaptors_test kpeter@698: bellman_ford_test ladanyi@141: bfs_test alpar@424: circulation_test kpeter@649: connectivity_test ladanyi@141: counter_test ladanyi@141: dfs_test ladanyi@141: digraph_test kpeter@170: dijkstra_test ladanyi@141: dim_test deba@488: edge_set_test ladanyi@141: error_test ladanyi@522: euler_test deba@869: fractional_matching_test tapolcai@543: gomory_hu_test deba@200: graph_copy_test ladanyi@141: graph_test kpeter@171: graph_utils_test deba@410: hao_orlin_test deba@203: heap_test ladanyi@141: kruskal_test alpar@949: lgf_test ladanyi@141: maps_test kpeter@594: matching_test thoneyvazul@916: max_cardinality_search_test kpeter@904: max_clique_test deba@501: min_cost_arborescence_test kpeter@601: min_cost_flow_test kpeter@763: min_mean_cycle_test deba@913: nagamochi_ibaraki_test alpar@424: path_test deba@797: planarity_test alpar@424: preflow_test ladanyi@473: radix_sort_test alpar@225: random_test alpar@424: suurballe_test ladanyi@141: time_measure_test ladanyi@679: unionfind_test ladanyi@679: ) ladanyi@510: ladanyi@627: IF(LEMON_HAVE_LP) alpar@927: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@927: ADD_EXECUTABLE(lp_test lp_test.cc) alpar@927: ELSE() alpar@927: ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) alpar@927: ENDIF() alpar@927: ladanyi@620: SET(LP_TEST_LIBS lemon) ladanyi@679: ladanyi@627: IF(LEMON_HAVE_GLPK) ladanyi@620: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@627: IF(LEMON_HAVE_CPLEX) ladanyi@620: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@627: IF(LEMON_HAVE_CLP) ladanyi@621: SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@679: ladanyi@620: TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) ladanyi@473: ADD_TEST(lp_test lp_test) alpar@945: ADD_DEPENDENCIES(check lp_test) ladanyi@473: ladanyi@627: IF(WIN32 AND LEMON_HAVE_GLPK) ladanyi@473: GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) ladanyi@473: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@473: ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ladanyi@473: ) ladanyi@679: ENDIF() ladanyi@679: ladanyi@627: IF(WIN32 AND LEMON_HAVE_CPLEX) ladanyi@620: GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) ladanyi@620: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@620: ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD alpar@972: COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} ladanyi@620: ) ladanyi@679: ENDIF() ladanyi@679: ENDIF() ladanyi@473: ladanyi@627: IF(LEMON_HAVE_MIP) alpar@927: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@927: ADD_EXECUTABLE(mip_test mip_test.cc) alpar@927: ELSE() alpar@927: ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) alpar@927: ENDIF() alpar@927: ladanyi@620: SET(MIP_TEST_LIBS lemon) ladanyi@679: ladanyi@627: IF(LEMON_HAVE_GLPK) ladanyi@620: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@627: IF(LEMON_HAVE_CPLEX) ladanyi@620: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@627: IF(LEMON_HAVE_CBC) ladanyi@621: SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) ladanyi@679: ENDIF() ladanyi@679: ladanyi@620: TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) ladanyi@473: ADD_TEST(mip_test mip_test) alpar@945: ADD_DEPENDENCIES(check mip_test) ladanyi@473: ladanyi@627: IF(WIN32 AND LEMON_HAVE_GLPK) ladanyi@473: GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) ladanyi@473: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@473: ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} ladanyi@679: COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} ladanyi@473: ) ladanyi@679: ENDIF() ladanyi@679: ladanyi@627: IF(WIN32 AND LEMON_HAVE_CPLEX) ladanyi@620: GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) ladanyi@620: GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) ladanyi@620: ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD alpar@972: COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} ladanyi@620: ) ladanyi@679: ENDIF() ladanyi@679: ENDIF() ladanyi@141: alpar@225: FOREACH(TEST_NAME ${TESTS}) alpar@927: IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") alpar@927: ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) alpar@927: ELSE() alpar@927: ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) alpar@927: ENDIF() alpar@225: TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) alpar@933: IF(TEST_WITH_VALGRIND) alpar@933: ADD_TEST(${TEST_NAME} alpar@933: valgrind --error-exitcode=1 ${VALGRIND_FLAGS} alpar@933: ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) alpar@933: ELSE() alpar@933: ADD_TEST(${TEST_NAME} ${TEST_NAME}) alpar@933: ENDIF() alpar@927: ADD_DEPENDENCIES(check ${TEST_NAME}) ladanyi@679: ENDFOREACH()