COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 1095:ad40f7d32846

Last change on this file since 1095:ad40f7d32846 was 998:7fdaa05a69a1, checked in by Alpar Juttner <alpar@…>, 12 years ago

Merge #449 to branches >=1.2

File size: 4.0 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
[501]40  min_cost_arborescence_test
[601]41  min_cost_flow_test
[763]42  min_mean_cycle_test
[424]43  path_test
[797]44  planarity_test
[424]45  preflow_test
[473]46  radix_sort_test
[225]47  random_test
[424]48  suurballe_test
[141]49  time_measure_test
[679]50  unionfind_test
51)
[510]52
[627]53IF(LEMON_HAVE_LP)
[927]54  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
55    ADD_EXECUTABLE(lp_test lp_test.cc)
56  ELSE()
57    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
58  ENDIF()
59
[620]60  SET(LP_TEST_LIBS lemon)
[679]61
[627]62  IF(LEMON_HAVE_GLPK)
[620]63    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]64  ENDIF()
[627]65  IF(LEMON_HAVE_CPLEX)
[620]66    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]67  ENDIF()
[627]68  IF(LEMON_HAVE_CLP)
[621]69    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[679]70  ENDIF()
71
[620]72  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[473]73  ADD_TEST(lp_test lp_test)
[945]74  ADD_DEPENDENCIES(check lp_test)
[473]75
[627]76  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]77    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
78    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
79    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[679]80      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
81      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
82      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]83    )
[679]84  ENDIF()
85
[627]86  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]87    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
88    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
89    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[972]90      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[620]91    )
[679]92  ENDIF()
93ENDIF()
[473]94
[627]95IF(LEMON_HAVE_MIP)
[927]96  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
97    ADD_EXECUTABLE(mip_test mip_test.cc)
98  ELSE()
99    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
100  ENDIF()
101
[620]102  SET(MIP_TEST_LIBS lemon)
[679]103
[627]104  IF(LEMON_HAVE_GLPK)
[620]105    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]106  ENDIF()
[627]107  IF(LEMON_HAVE_CPLEX)
[620]108    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]109  ENDIF()
[627]110  IF(LEMON_HAVE_CBC)
[621]111    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[679]112  ENDIF()
113
[620]114  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[473]115  ADD_TEST(mip_test mip_test)
[945]116  ADD_DEPENDENCIES(check mip_test)
[473]117
[627]118  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]119    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
120    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
121    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[679]122      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
123      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
124      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]125    )
[679]126  ENDIF()
127
[627]128  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]129    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
130    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
131    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[972]132      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
[620]133    )
[679]134  ENDIF()
135ENDIF()
[141]136
[225]137FOREACH(TEST_NAME ${TESTS})
[927]138  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
139    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
140  ELSE()
141    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
142  ENDIF()
[225]143  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
[933]144    IF(TEST_WITH_VALGRIND)
145      ADD_TEST(${TEST_NAME}
146        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
147        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
148    ELSE()
149      ADD_TEST(${TEST_NAME} ${TEST_NAME})
150    ENDIF()
[927]151  ADD_DEPENDENCIES(check ${TEST_NAME})
[679]152ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.