COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 558:f53d641aa967

Last change on this file since 558:f53d641aa967 was 549:ba659d676331, checked in by Akos Ladanyi <ladanyi@…>, 16 years ago

Make it possible to use LEMON as a CMake subproject (#240)

File size: 2.0 KB
RevLine 
[473]1INCLUDE_DIRECTORIES(
[549]2  ${PROJECT_SOURCE_DIR}
3  ${PROJECT_BINARY_DIR}
[473]4)
[410]5
[474]6IF(HAVE_GLPK)
7  INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR})
8ENDIF(HAVE_GLPK)
[141]9
[549]10LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
[141]11
[225]12SET(TESTS
[488]13  adaptors_test
[141]14  bfs_test
[424]15  circulation_test
[141]16  counter_test
17  dfs_test
18  digraph_test
[170]19  dijkstra_test
[141]20  dim_test
[488]21  edge_set_test
[141]22  error_test
[522]23  euler_test
[543]24  gomory_hu_test
[200]25  graph_copy_test
[141]26  graph_test
[171]27  graph_utils_test
[410]28  hao_orlin_test
[203]29  heap_test
[141]30  kruskal_test
31  maps_test
[326]32  max_matching_test
[501]33  min_cost_arborescence_test
[424]34  path_test
35  preflow_test
[473]36  radix_sort_test
[225]37  random_test
[424]38  suurballe_test
[141]39  time_measure_test
40  unionfind_test)
41
[473]42IF(HAVE_LP)
43  ADD_EXECUTABLE(lp_test lp_test.cc)
[474]44  IF(HAVE_GLPK)
45    TARGET_LINK_LIBRARIES(lp_test lemon ${GLPK_LIBRARIES})
46  ENDIF(HAVE_GLPK)
[473]47  ADD_TEST(lp_test lp_test)
48
[474]49  IF(WIN32 AND HAVE_GLPK)
[473]50    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
51    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
52    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
53      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
54      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
55      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
56    )
[474]57  ENDIF(WIN32 AND HAVE_GLPK)
[473]58ENDIF(HAVE_LP)
59
60IF(HAVE_MIP)
61  ADD_EXECUTABLE(mip_test mip_test.cc)
[474]62  IF(HAVE_GLPK)
63    TARGET_LINK_LIBRARIES(mip_test lemon ${GLPK_LIBRARIES})
64  ENDIF(HAVE_GLPK)
[473]65  ADD_TEST(mip_test mip_test)
66
[474]67  IF(WIN32 AND HAVE_GLPK)
[473]68    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
69    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
70    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
71      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
72      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
73      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
74    )
[474]75  ENDIF(WIN32 AND HAVE_GLPK)
[473]76ENDIF(HAVE_MIP)
77
[225]78FOREACH(TEST_NAME ${TESTS})
79  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
80  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
81  ADD_TEST(${TEST_NAME} ${TEST_NAME})
82ENDFOREACH(TEST_NAME)
Note: See TracBrowser for help on using the repository browser.