COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1035:d149eaf24638

1.2
Last change on this file since 1035:d149eaf24638 was 1035:d149eaf24638, checked in by Alpar Juttner <alpar@…>, 9 years ago

Merge CMAKE backports to branch 1.2

File size: 3.6 KB
RevLine 
[539]1INCLUDE_DIRECTORIES(
[596]2  ${PROJECT_SOURCE_DIR}
[539]3  ${PROJECT_BINARY_DIR}
4)
[141]5
[726]6LINK_DIRECTORIES(
7  ${PROJECT_BINARY_DIR}/lemon
8)
[141]9
[225]10SET(TESTS
[559]11  adaptors_test
[745]12  bellman_ford_test
[141]13  bfs_test
[443]14  circulation_test
[696]15  connectivity_test
[141]16  counter_test
17  dfs_test
18  digraph_test
[170]19  dijkstra_test
[141]20  dim_test
[559]21  edge_set_test
[141]22  error_test
[569]23  euler_test
[948]24  fractional_matching_test
[590]25  gomory_hu_test
[200]26  graph_copy_test
[141]27  graph_test
[171]28  graph_utils_test
[426]29  hao_orlin_test
[203]30  heap_test
[141]31  kruskal_test
32  maps_test
[641]33  matching_test
[522]34  min_cost_arborescence_test
[648]35  min_cost_flow_test
[810]36  min_mean_cycle_test
[443]37  path_test
[861]38  planarity_test
[443]39  preflow_test
[496]40  radix_sort_test
[225]41  random_test
[443]42  suurballe_test
[141]43  time_measure_test
[726]44  unionfind_test
45)
[141]46
[674]47IF(LEMON_HAVE_LP)
[1033]48  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
49    ADD_EXECUTABLE(lp_test lp_test.cc)
50  ELSE()
51    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
52  ENDIF()
53
[667]54  SET(LP_TEST_LIBS lemon)
[726]55
[674]56  IF(LEMON_HAVE_GLPK)
[667]57    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]58  ENDIF()
[674]59  IF(LEMON_HAVE_CPLEX)
[667]60    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]61  ENDIF()
[674]62  IF(LEMON_HAVE_CLP)
[668]63    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[726]64  ENDIF()
65
[667]66  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[496]67  ADD_TEST(lp_test lp_test)
68
[674]69  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]70    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
71    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
72    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[726]73      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
74      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
75      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]76    )
[726]77  ENDIF()
78
[674]79  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]80    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
81    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
82    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[726]83      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[667]84    )
[726]85  ENDIF()
86ENDIF()
[496]87
[674]88IF(LEMON_HAVE_MIP)
[1033]89  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
90    ADD_EXECUTABLE(mip_test mip_test.cc)
91  ELSE()
92    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
93  ENDIF()
94
[667]95  SET(MIP_TEST_LIBS lemon)
[726]96
[674]97  IF(LEMON_HAVE_GLPK)
[667]98    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]99  ENDIF()
[674]100  IF(LEMON_HAVE_CPLEX)
[667]101    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]102  ENDIF()
[674]103  IF(LEMON_HAVE_CBC)
[668]104    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[726]105  ENDIF()
106
[667]107  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[496]108  ADD_TEST(mip_test mip_test)
109
[674]110  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]111    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
112    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
113    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[726]114      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
115      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
116      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]117    )
[726]118  ENDIF()
119
[674]120  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]121    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
122    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
123    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[726]124      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[667]125    )
[726]126  ENDIF()
127ENDIF()
[496]128
[225]129FOREACH(TEST_NAME ${TESTS})
[1033]130  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
131    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
132  ELSE()
133    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
134  ENDIF()
[225]135  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
136  ADD_TEST(${TEST_NAME} ${TEST_NAME})
[1033]137  ADD_DEPENDENCIES(check ${TEST_NAME})
[726]138ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.