COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 667:c3ce597c11ae

Last change on this file since 667:c3ce597c11ae was 667:c3ce597c11ae, checked in by Akos Ladanyi <ladanyi@…>, 10 years ago

FindCPLEX for CMake (#256)

File size: 2.9 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  counter_test
13  dfs_test
14  digraph_test
15  dijkstra_test
16  dim_test
17  edge_set_test
18  error_test
19  euler_test
20  gomory_hu_test
21  graph_copy_test
22  graph_test
23  graph_utils_test
24  hao_orlin_test
25  heap_test
26  kruskal_test
27  maps_test
28  matching_test
29  min_cost_arborescence_test
30  min_cost_flow_test
31  path_test
32  preflow_test
33  radix_sort_test
34  random_test
35  suurballe_test
36  time_measure_test
37  unionfind_test)
38
39IF(HAVE_LP)
40  ADD_EXECUTABLE(lp_test lp_test.cc)
41  SET(LP_TEST_LIBS lemon)
42  IF(HAVE_GLPK)
43    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
44  ENDIF(HAVE_GLPK)
45  IF(HAVE_CPLEX)
46    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
47  ENDIF(HAVE_CPLEX)
48  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
49  ADD_TEST(lp_test lp_test)
50
51  IF(WIN32 AND HAVE_GLPK)
52    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
53    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
54    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
55      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
56      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
57      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
58    )
59  ENDIF(WIN32 AND HAVE_GLPK)
60  IF(WIN32 AND HAVE_CPLEX)
61    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
62    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
63    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
64      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
65    )
66  ENDIF(WIN32 AND HAVE_CPLEX)
67ENDIF(HAVE_LP)
68
69IF(HAVE_MIP)
70  ADD_EXECUTABLE(mip_test mip_test.cc)
71  SET(MIP_TEST_LIBS lemon)
72  IF(HAVE_GLPK)
73    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
74  ENDIF(HAVE_GLPK)
75  IF(HAVE_CPLEX)
76    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
77  ENDIF(HAVE_CPLEX)
78  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
79  ADD_TEST(mip_test mip_test)
80
81  IF(WIN32 AND HAVE_GLPK)
82    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
83    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
84    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
85      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
86      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
87      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
88    )
89  ENDIF(WIN32 AND HAVE_GLPK)
90  IF(WIN32 AND HAVE_CPLEX)
91    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
92    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
93    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
94      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
95    )
96  ENDIF(WIN32 AND HAVE_CPLEX)
97ENDIF(HAVE_MIP)
98
99FOREACH(TEST_NAME ${TESTS})
100  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
101  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
102  ADD_TEST(${TEST_NAME} ${TEST_NAME})
103ENDFOREACH(TEST_NAME)
Note: See TracBrowser for help on using the repository browser.