COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1040:8e39ccaabf48

Last change on this file since 1040:8e39ccaabf48 was 1040:8e39ccaabf48, checked in by Alpar Juttner <alpar@…>, 9 years ago

Merge #404

File size: 3.7 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
[1020]34  max_cardinality_search_test
[999]35  max_clique_test
[522]36  min_cost_arborescence_test
[648]37  min_cost_flow_test
[810]38  min_mean_cycle_test
[1017]39  nagamochi_ibaraki_test
[443]40  path_test
[861]41  planarity_test
[443]42  preflow_test
[496]43  radix_sort_test
[225]44  random_test
[443]45  suurballe_test
[141]46  time_measure_test
[726]47  unionfind_test
48)
[141]49
[674]50IF(LEMON_HAVE_LP)
[1033]51  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
52    ADD_EXECUTABLE(lp_test lp_test.cc)
53  ELSE()
54    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
55  ENDIF()
56
[667]57  SET(LP_TEST_LIBS lemon)
[726]58
[674]59  IF(LEMON_HAVE_GLPK)
[667]60    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]61  ENDIF()
[674]62  IF(LEMON_HAVE_CPLEX)
[667]63    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]64  ENDIF()
[674]65  IF(LEMON_HAVE_CLP)
[668]66    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[726]67  ENDIF()
68
[667]69  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[496]70  ADD_TEST(lp_test lp_test)
71
[674]72  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]73    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
74    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
75    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[726]76      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
77      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
78      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]79    )
[726]80  ENDIF()
81
[674]82  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]83    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
84    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
85    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[726]86      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[667]87    )
[726]88  ENDIF()
89ENDIF()
[496]90
[674]91IF(LEMON_HAVE_MIP)
[1033]92  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
93    ADD_EXECUTABLE(mip_test mip_test.cc)
94  ELSE()
95    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
96  ENDIF()
97
[667]98  SET(MIP_TEST_LIBS lemon)
[726]99
[674]100  IF(LEMON_HAVE_GLPK)
[667]101    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[726]102  ENDIF()
[674]103  IF(LEMON_HAVE_CPLEX)
[667]104    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[726]105  ENDIF()
[674]106  IF(LEMON_HAVE_CBC)
[668]107    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[726]108  ENDIF()
109
[667]110  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[496]111  ADD_TEST(mip_test mip_test)
112
[674]113  IF(WIN32 AND LEMON_HAVE_GLPK)
[496]114    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
115    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
116    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[726]117      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
118      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
119      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[496]120    )
[726]121  ENDIF()
122
[674]123  IF(WIN32 AND LEMON_HAVE_CPLEX)
[667]124    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
125    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
126    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[726]127      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[667]128    )
[726]129  ENDIF()
130ENDIF()
[496]131
[225]132FOREACH(TEST_NAME ${TESTS})
[1033]133  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
134    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
135  ELSE()
136    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
137  ENDIF()
[225]138  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
139  ADD_TEST(${TEST_NAME} ${TEST_NAME})
[1033]140  ADD_DEPENDENCIES(check ${TEST_NAME})
[726]141ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.