COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 722:c5dc4d3124aa

Last change on this file since 722:c5dc4d3124aa was 696:76cbcb3e9bbb, checked in by Peter Kovacs <kpeter@…>, 12 years ago

Add a test file for the connectivity functions (#285)
The Euler tools have a separate test file.

File size: 3.2 KB
RevLine 
[539]1INCLUDE_DIRECTORIES(
[596]2  ${PROJECT_SOURCE_DIR}
[539]3  ${PROJECT_BINARY_DIR}
4)
[141]5
[596]6LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
[141]7
[225]8SET(TESTS
[559]9  adaptors_test
[141]10  bfs_test
[443]11  circulation_test
[696]12  connectivity_test
[141]13  counter_test
14  dfs_test
15  digraph_test
[170]16  dijkstra_test
[141]17  dim_test
[559]18  edge_set_test
[141]19  error_test
[569]20  euler_test
[590]21  gomory_hu_test
[200]22  graph_copy_test
[141]23  graph_test
[171]24  graph_utils_test
[426]25  hao_orlin_test
[203]26  heap_test
[141]27  kruskal_test
28  maps_test
[641]29  matching_test
[522]30  min_cost_arborescence_test
[648]31  min_cost_flow_test
[443]32  path_test
33  preflow_test
[496]34  radix_sort_test
[225]35  random_test
[443]36  suurballe_test
[141]37  time_measure_test
38  unionfind_test)
39
[674]40IF(LEMON_HAVE_LP)
[496]41  ADD_EXECUTABLE(lp_test lp_test.cc)
[667]42  SET(LP_TEST_LIBS lemon)
[674]43  IF(LEMON_HAVE_GLPK)
[667]44    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[674]45  ENDIF(LEMON_HAVE_GLPK)
46  IF(LEMON_HAVE_CPLEX)
[667]47    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[674]48  ENDIF(LEMON_HAVE_CPLEX)
49  IF(LEMON_HAVE_CLP)
[668]50    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[674]51  ENDIF(LEMON_HAVE_CLP)
[667]52  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[496]53  ADD_TEST(lp_test lp_test)
54
[674]55  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]56    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
57    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
58    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
59      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
60      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
61      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
62    )
[674]63  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
64  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]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 -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
69    )
[674]70  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
71ENDIF(LEMON_HAVE_LP)
[496]72
[674]73IF(LEMON_HAVE_MIP)
[496]74  ADD_EXECUTABLE(mip_test mip_test.cc)
[667]75  SET(MIP_TEST_LIBS lemon)
[674]76  IF(LEMON_HAVE_GLPK)
[667]77    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[674]78  ENDIF(LEMON_HAVE_GLPK)
79  IF(LEMON_HAVE_CPLEX)
[667]80    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[674]81  ENDIF(LEMON_HAVE_CPLEX)
82  IF(LEMON_HAVE_CBC)
[668]83    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[674]84  ENDIF(LEMON_HAVE_CBC)
[667]85  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[496]86  ADD_TEST(mip_test mip_test)
87
[674]88  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]89    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
90    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
91    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
92      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
93      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
94      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
95    )
[674]96  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
97  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]98    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
99    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
100    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
101      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
102    )
[674]103  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
104ENDIF(LEMON_HAVE_MIP)
[496]105
[225]106FOREACH(TEST_NAME ${TESTS})
107  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
108  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
109  ADD_TEST(${TEST_NAME} ${TEST_NAME})
110ENDFOREACH(TEST_NAME)
Note: See TracBrowser for help on using the repository browser.