COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 1004:d59484d5fc1f

Last change on this file since 1004:d59484d5fc1f was 1000:404b98971e1f, checked in by Alpar Juttner <alpar@…>, 12 years ago

Merge #449

File size: 4.1 KB
RevLine 
[510]1INCLUDE_DIRECTORIES(
[549]2  ${PROJECT_SOURCE_DIR}
[510]3  ${PROJECT_BINARY_DIR}
4)
[141]5
[679]6LINK_DIRECTORIES(
7  ${PROJECT_BINARY_DIR}/lemon
8)
[510]9
[933]10SET(TEST_WITH_VALGRIND "NO" CACHE STRING
11  "Run the test with valgrind (YES/NO).")
12SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
[141]13
[225]14SET(TESTS
[488]15  adaptors_test
[993]16  arc_look_up_test
[698]17  bellman_ford_test
[141]18  bfs_test
[424]19  circulation_test
[649]20  connectivity_test
[141]21  counter_test
22  dfs_test
23  digraph_test
[170]24  dijkstra_test
[141]25  dim_test
[488]26  edge_set_test
[141]27  error_test
[522]28  euler_test
[869]29  fractional_matching_test
[543]30  gomory_hu_test
[200]31  graph_copy_test
[141]32  graph_test
[171]33  graph_utils_test
[410]34  hao_orlin_test
[203]35  heap_test
[141]36  kruskal_test
[949]37  lgf_test
[141]38  maps_test
[594]39  matching_test
[916]40  max_cardinality_search_test
[904]41  max_clique_test
[501]42  min_cost_arborescence_test
[601]43  min_cost_flow_test
[763]44  min_mean_cycle_test
[913]45  nagamochi_ibaraki_test
[424]46  path_test
[797]47  planarity_test
[424]48  preflow_test
[473]49  radix_sort_test
[225]50  random_test
[424]51  suurballe_test
[141]52  time_measure_test
[679]53  unionfind_test
54)
[510]55
[627]56IF(LEMON_HAVE_LP)
[927]57  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
58    ADD_EXECUTABLE(lp_test lp_test.cc)
59  ELSE()
60    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
61  ENDIF()
62
[620]63  SET(LP_TEST_LIBS lemon)
[679]64
[627]65  IF(LEMON_HAVE_GLPK)
[620]66    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]67  ENDIF()
[627]68  IF(LEMON_HAVE_CPLEX)
[620]69    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]70  ENDIF()
[627]71  IF(LEMON_HAVE_CLP)
[621]72    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[679]73  ENDIF()
74
[620]75  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[473]76  ADD_TEST(lp_test lp_test)
[945]77  ADD_DEPENDENCIES(check lp_test)
[473]78
[627]79  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]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
[679]83      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
84      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
85      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]86    )
[679]87  ENDIF()
88
[627]89  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]90    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
91    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
92    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[972]93      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[620]94    )
[679]95  ENDIF()
96ENDIF()
[473]97
[627]98IF(LEMON_HAVE_MIP)
[927]99  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
100    ADD_EXECUTABLE(mip_test mip_test.cc)
101  ELSE()
102    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
103  ENDIF()
104
[620]105  SET(MIP_TEST_LIBS lemon)
[679]106
[627]107  IF(LEMON_HAVE_GLPK)
[620]108    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]109  ENDIF()
[627]110  IF(LEMON_HAVE_CPLEX)
[620]111    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]112  ENDIF()
[627]113  IF(LEMON_HAVE_CBC)
[621]114    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[679]115  ENDIF()
116
[620]117  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[473]118  ADD_TEST(mip_test mip_test)
[945]119  ADD_DEPENDENCIES(check mip_test)
[473]120
[627]121  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]122    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
123    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
124    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[679]125      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
126      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
127      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]128    )
[679]129  ENDIF()
130
[627]131  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]132    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
133    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
134    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[972]135      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[620]136    )
[679]137  ENDIF()
138ENDIF()
[141]139
[225]140FOREACH(TEST_NAME ${TESTS})
[927]141  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
142    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
143  ELSE()
144    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
145  ENDIF()
[225]146  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
[933]147    IF(TEST_WITH_VALGRIND)
148      ADD_TEST(${TEST_NAME}
149        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
150        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
151    ELSE()
152      ADD_TEST(${TEST_NAME} ${TEST_NAME})
153    ENDIF()
[927]154  ADD_DEPENDENCIES(check ${TEST_NAME})
[679]155ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.