COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1198:4936be66d2f5

Last change on this file since 1198:4936be66d2f5 was 1198:4936be66d2f5, checked in by Balazs Dezso <deba@…>, 9 years ago

Changes in BpGraph? lgf reader and writer (#69)

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