COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 674:20dac2104519

Last change on this file since 674:20dac2104519 was 674:20dac2104519, checked in by Akos Ladanyi <ladanyi@…>, 11 years ago

Merge and extend the fix of #275

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