COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1011:1937b6455b7d

Last change on this file since 1011:1937b6455b7d was 1000:de428ebb47ab, checked in by Alpar Juttner <alpar@…>, 10 years ago

Merge #380

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