COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 880:b89e46862dc2

Last change on this file since 880:b89e46862dc2 was 874:d8ea85825e02, checked in by Alpar Juttner <alpar@…>, 15 years ago

Merge #314

File size: 3.2 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  min_cost_arborescence_test
35  min_cost_flow_test
36  min_mean_cycle_test
37  path_test
38  planarity_test
39  preflow_test
40  radix_sort_test
41  random_test
42  suurballe_test
43  time_measure_test
44  unionfind_test
45)
46
47IF(LEMON_HAVE_LP)
48  ADD_EXECUTABLE(lp_test lp_test.cc)
49  SET(LP_TEST_LIBS lemon)
50
51  IF(LEMON_HAVE_GLPK)
52    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
53  ENDIF()
54  IF(LEMON_HAVE_CPLEX)
55    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
56  ENDIF()
57  IF(LEMON_HAVE_CLP)
58    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
59  ENDIF()
60
61  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
62  ADD_TEST(lp_test lp_test)
63
64  IF(WIN32 AND LEMON_HAVE_GLPK)
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_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
69      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
70      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
71    )
72  ENDIF()
73
74  IF(WIN32 AND LEMON_HAVE_CPLEX)
75    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
76    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
77    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
78      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
79    )
80  ENDIF()
81ENDIF()
82
83IF(LEMON_HAVE_MIP)
84  ADD_EXECUTABLE(mip_test mip_test.cc)
85  SET(MIP_TEST_LIBS lemon)
86
87  IF(LEMON_HAVE_GLPK)
88    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
89  ENDIF()
90  IF(LEMON_HAVE_CPLEX)
91    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
92  ENDIF()
93  IF(LEMON_HAVE_CBC)
94    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
95  ENDIF()
96
97  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
98  ADD_TEST(mip_test mip_test)
99
100  IF(WIN32 AND LEMON_HAVE_GLPK)
101    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
102    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
103    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
104      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
105      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
106      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
107    )
108  ENDIF()
109
110  IF(WIN32 AND LEMON_HAVE_CPLEX)
111    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
112    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
113    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
114      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
115    )
116  ENDIF()
117ENDIF()
118
119FOREACH(TEST_NAME ${TESTS})
120  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
121  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
122  ADD_TEST(${TEST_NAME} ${TEST_NAME})
123ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.