COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 496:17d918051964

Last change on this file since 496:17d918051964 was 496:17d918051964, checked in by Akos Ladanyi <ladanyi@…>, 11 years ago

Build GLPK dependent parts with CMake too

File size: 1.8 KB
Line 
1INCLUDE_DIRECTORIES(
2  ${CMAKE_SOURCE_DIR}
3  ${CMAKE_BINARY_DIR}
4  ${GLPK_INCLUDE_DIR}
5)
6
7LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
8
9SET(TESTS
10  adaptors_test
11  bfs_test
12  circulation_test
13  counter_test
14  dfs_test
15  digraph_test
16  dijkstra_test
17  dim_test
18  edge_set_test
19  error_test
20  graph_copy_test
21  graph_test
22  graph_utils_test
23  hao_orlin_test
24  heap_test
25  kruskal_test
26  maps_test
27  max_matching_test
28  path_test
29  preflow_test
30  radix_sort_test
31  random_test
32  suurballe_test
33  time_measure_test
34  unionfind_test)
35
36IF(HAVE_LP)
37  ADD_EXECUTABLE(lp_test lp_test.cc)
38  TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
39  ADD_TEST(lp_test lp_test)
40
41  IF(WIN32)
42    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
43    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
44    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
45      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
46      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
47      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
48    )
49  ENDIF(WIN32)
50ENDIF(HAVE_LP)
51
52IF(HAVE_MIP)
53  ADD_EXECUTABLE(mip_test mip_test.cc)
54  TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
55  ADD_TEST(mip_test mip_test)
56
57  IF(WIN32)
58    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
59    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
60    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
61      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
62      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
63      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
64    )
65  ENDIF(WIN32)
66ENDIF(HAVE_MIP)
67
68FOREACH(TEST_NAME ${TESTS})
69  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
70  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
71  ADD_TEST(${TEST_NAME} ${TEST_NAME})
72ENDFOREACH(TEST_NAME)
Note: See TracBrowser for help on using the repository browser.