COIN-OR::LEMON - Graph Library

source: lemon/test/CMakeLists.txt @ 1033:16d466589b54

Last change on this file since 1033:16d466589b54 was 1033:16d466589b54, checked in by Alpar Juttner <alpar@…>, 10 years ago

Backport the CMAKE related changesets from the main branch

[e20fecd1945f] Add check target for CMake (#388)
[e74b5db4f2c6] Put the output of chg-len.py in the version string (#389)
[7d166b8b8018] Safer call of ./scripts/chg-len.py on Windows (#389)
[659ba4805a48] Make CMAKE config more consistent with configure.ac (#390)
[63e4468c680e] Add 'Maintainer' CMAKE build type (#388, #390)
[a725503acfe9] Allow CPACK configuration on all platforms
[10242c611190] Create and install lemon.pc (#393)
[48e29534cf03] The deafult target doesn't build lp_test and mip_test (#388)
[0fbbdd578c06] Full path for DoxygenLayout?.xml in Doxyfile.in (#395)
[481496e6d71f] SOURCE_BROWSER Doxygen switch is configurable from CMAKE (#395)
[09282720100b] update-external-tags CMAKE target (#395)

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