COIN-OR::LEMON - Graph Library

source: lemon-main/test/CMakeLists.txt @ 902:a725503acfe9

Last change on this file since 902:a725503acfe9 was 901:63e4468c680e, checked in by Alpar Juttner <alpar@…>, 14 years ago

Add 'Maintainer' CMAKE build type (#388, #390)

  • some extra warning and debug options
  • build stops on warning (-Werror)
  • tests are built and run by default
File size: 3.3 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)
[141]9
[225]10SET(TESTS
[488]11  adaptors_test
[698]12  bellman_ford_test
[141]13  bfs_test
[424]14  circulation_test
[649]15  connectivity_test
[141]16  counter_test
17  dfs_test
18  digraph_test
[170]19  dijkstra_test
[141]20  dim_test
[488]21  edge_set_test
[141]22  error_test
[522]23  euler_test
[869]24  fractional_matching_test
[543]25  gomory_hu_test
[200]26  graph_copy_test
[141]27  graph_test
[171]28  graph_utils_test
[410]29  hao_orlin_test
[203]30  heap_test
[141]31  kruskal_test
32  maps_test
[594]33  matching_test
[501]34  min_cost_arborescence_test
[601]35  min_cost_flow_test
[763]36  min_mean_cycle_test
[424]37  path_test
[797]38  planarity_test
[424]39  preflow_test
[473]40  radix_sort_test
[225]41  random_test
[424]42  suurballe_test
[141]43  time_measure_test
[679]44  unionfind_test
45)
[141]46
[627]47IF(LEMON_HAVE_LP)
[473]48  ADD_EXECUTABLE(lp_test lp_test.cc)
[620]49  SET(LP_TEST_LIBS lemon)
[679]50
[627]51  IF(LEMON_HAVE_GLPK)
[620]52    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]53  ENDIF()
[627]54  IF(LEMON_HAVE_CPLEX)
[620]55    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]56  ENDIF()
[627]57  IF(LEMON_HAVE_CLP)
[621]58    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
[679]59  ENDIF()
60
[620]61  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
[473]62  ADD_TEST(lp_test lp_test)
63
[627]64  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]65    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
66    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
67    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[679]68      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
69      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
70      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]71    )
[679]72  ENDIF()
73
[627]74  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]75    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
76    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
77    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
[679]78      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[620]79    )
[679]80  ENDIF()
81ENDIF()
[473]82
[627]83IF(LEMON_HAVE_MIP)
[473]84  ADD_EXECUTABLE(mip_test mip_test.cc)
[620]85  SET(MIP_TEST_LIBS lemon)
[679]86
[627]87  IF(LEMON_HAVE_GLPK)
[620]88    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
[679]89  ENDIF()
[627]90  IF(LEMON_HAVE_CPLEX)
[620]91    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
[679]92  ENDIF()
[627]93  IF(LEMON_HAVE_CBC)
[621]94    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
[679]95  ENDIF()
96
[620]97  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
[473]98  ADD_TEST(mip_test mip_test)
99
[627]100  IF(WIN32 AND LEMON_HAVE_GLPK)
[473]101    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
102    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
103    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
[679]104      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
105      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
106      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
[473]107    )
[679]108  ENDIF()
109
[627]110  IF(WIN32 AND LEMON_HAVE_CPLEX)
[620]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
[679]114      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
[620]115    )
[679]116  ENDIF()
117ENDIF()
[473]118
[225]119FOREACH(TEST_NAME ${TESTS})
[901]120  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
121    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
122  ELSE()
123    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
124  ENDIF()
[225]125  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
126  ADD_TEST(${TEST_NAME} ${TEST_NAME})
[897]127  ADD_DEPENDENCIES(check ${TEST_NAME})
[679]128ENDFOREACH()
Note: See TracBrowser for help on using the repository browser.