COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1162:404b98971e1f

Last change on this file since 1162:404b98971e1f was 1162:404b98971e1f, checked in by Alpar Juttner <alpar@…>, 9 years ago

Merge #449

File size: 4.1 KB
RevLine 
[539]1INCLUDE_DIRECTORIES(
[596]2  ${PROJECT_SOURCE_DIR}
[539]3  ${PROJECT_BINARY_DIR}
4)
[141]5
[726]6LINK_DIRECTORIES(
7  ${PROJECT_BINARY_DIR}/lemon
8)
[539]9
[1044]10SET(TEST_WITH_VALGRIND "NO" CACHE STRING
11  "Run the test with valgrind (YES/NO).")
12SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
[141]13
[225]14SET(TESTS
[559]15  adaptors_test
[1149]16  arc_look_up_test
[745]17  bellman_ford_test
[141]18  bfs_test
[443]19  circulation_test
[696]20  connectivity_test
[141]21  counter_test
22  dfs_test
23  digraph_test
[170]24  dijkstra_test
[141]25  dim_test
[559]26  edge_set_test
[141]27  error_test
[569]28  euler_test
[948]29  fractional_matching_test
[590]30  gomory_hu_test
[200]31  graph_copy_test
[141]32  graph_test
[171]33  graph_utils_test
[426]34  hao_orlin_test
[203]35  heap_test
[141]36  kruskal_test
[1067]37  lgf_test
[141]38  maps_test
[641]39  matching_test
[1020]40  max_cardinality_search_test
[999]41  max_clique_test
[522]42  min_cost_arborescence_test
[648]43  min_cost_flow_test
[810]44  min_mean_cycle_test
[1017]45  nagamochi_ibaraki_test
[443]46  path_test
[861]47  planarity_test
[443]48  preflow_test
[496]49  radix_sort_test
[225]50  random_test
[443]51  suurballe_test
[141]52  time_measure_test
[726]53  unionfind_test
54)
[539]55
[674]56IF(LEMON_HAVE_LP)
[1033]57  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
58    ADD_EXECUTABLE(lp_test lp_test.cc)
59  ELSE()
60    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
61  ENDIF()
62
[667]63  SET(LP_TEST_LIBS lemon)
[726]64
[674]65  IF(LEMON_HAVE_GLPK)
[667]66    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]67  ENDIF()
[674]68  IF(LEMON_HAVE_CPLEX)
[667]69    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]70  ENDIF()
[674]71  IF(LEMON_HAVE_CLP)
[668]72    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[726]73  ENDIF()
74
[667]75  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[496]76  ADD_TEST(lp_test lp_test)
[1061]77  ADD_DEPENDENCIES(check lp_test)
[496]78
[674]79  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]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
[726]83      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
84      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
85      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]86    )
[726]87  ENDIF()
88
[674]89  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]90    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
91    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
92    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[1119]93      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[667]94    )
[726]95  ENDIF()
96ENDIF()
[496]97
[674]98IF(LEMON_HAVE_MIP)
[1033]99  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
100    ADD_EXECUTABLE(mip_test mip_test.cc)
101  ELSE()
102    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
103  ENDIF()
104
[667]105  SET(MIP_TEST_LIBS lemon)
[726]106
[674]107  IF(LEMON_HAVE_GLPK)
[667]108    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]109  ENDIF()
[674]110  IF(LEMON_HAVE_CPLEX)
[667]111    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]112  ENDIF()
[674]113  IF(LEMON_HAVE_CBC)
[668]114    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[726]115  ENDIF()
116
[667]117  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[496]118  ADD_TEST(mip_test mip_test)
[1061]119  ADD_DEPENDENCIES(check mip_test)
[496]120
[674]121  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]122    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
123    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
124    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[726]125      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
126      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
127      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]128    )
[726]129  ENDIF()
130
[674]131  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]132    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
133    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
134    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[1119]135      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[667]136    )
[726]137  ENDIF()
138ENDIF()
[141]139
[225]140FOREACH(TEST_NAME ${TESTS})
[1033]141  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
142    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
143  ELSE()
144    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
145  ENDIF()
[225]146  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
[1044]147    IF(TEST_WITH_VALGRIND)
148      ADD_TEST(${TEST_NAME}
149        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
150        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
151    ELSE()
152      ADD_TEST(${TEST_NAME} ${TEST_NAME})
153    ENDIF()
[1033]154  ADD_DEPENDENCIES(check ${TEST_NAME})
[726]155ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.