COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 663:8b0df68370a4

Last change on this file since 663:8b0df68370a4 was 649:76cbcb3e9bbb, checked in by Peter Kovacs <kpeter@…>, 15 years ago

Add a test file for the connectivity functions (#285)
The Euler tools have a separate test file.

File size: 3.2 KB
Line 
1INCLUDE_DIRECTORIES(
2  ${PROJECT_SOURCE_DIR}
3  ${PROJECT_BINARY_DIR}
4)
5
6LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
7
8SET(TESTS
9  adaptors_test
10  bfs_test
11  circulation_test
12  connectivity_test
13  counter_test
14  dfs_test
15  digraph_test
16  dijkstra_test
17  dim_test
18  edge_set_test
19  error_test
20  euler_test
21  gomory_hu_test
22  graph_copy_test
23  graph_test
24  graph_utils_test
25  hao_orlin_test
26  heap_test
27  kruskal_test
28  maps_test
29  matching_test
30  min_cost_arborescence_test
31  min_cost_flow_test
32  path_test
33  preflow_test
34  radix_sort_test
35  random_test
36  suurballe_test
37  time_measure_test
38  unionfind_test)
39
40IF(LEMON_HAVE_LP)
41  ADD_EXECUTABLE(lp_test lp_test.cc)
42  SET(LP_TEST_LIBS lemon)
43  IF(LEMON_HAVE_GLPK)
44    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
45  ENDIF(LEMON_HAVE_GLPK)
46  IF(LEMON_HAVE_CPLEX)
47    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
48  ENDIF(LEMON_HAVE_CPLEX)
49  IF(LEMON_HAVE_CLP)
50    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
51  ENDIF(LEMON_HAVE_CLP)
52  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
53  ADD_TEST(lp_test lp_test)
54
55  IF(WIN32 AND LEMON_HAVE_GLPK)
56    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
57    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
58    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
59      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
60      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
61      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
62    )
63  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
64  IF(WIN32 AND LEMON_HAVE_CPLEX)
65    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
66    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
67    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
68      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
69    )
70  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
71ENDIF(LEMON_HAVE_LP)
72
73IF(LEMON_HAVE_MIP)
74  ADD_EXECUTABLE(mip_test mip_test.cc)
75  SET(MIP_TEST_LIBS lemon)
76  IF(LEMON_HAVE_GLPK)
77    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
78  ENDIF(LEMON_HAVE_GLPK)
79  IF(LEMON_HAVE_CPLEX)
80    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
81  ENDIF(LEMON_HAVE_CPLEX)
82  IF(LEMON_HAVE_CBC)
83    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
84  ENDIF(LEMON_HAVE_CBC)
85  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
86  ADD_TEST(mip_test mip_test)
87
88  IF(WIN32 AND LEMON_HAVE_GLPK)
89    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
90    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
91    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
92      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
93      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
94      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
95    )
96  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
97  IF(WIN32 AND LEMON_HAVE_CPLEX)
98    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
99    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
100    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
101      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
102    )
103  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
104ENDIF(LEMON_HAVE_MIP)
105
106FOREACH(TEST_NAME ${TESTS})
107  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
108  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
109  ADD_TEST(${TEST_NAME} ${TEST_NAME})
110ENDFOREACH(TEST_NAME)
Note: See TracBrowser for help on using the repository browser.