COIN-OR::LEMON - Graph Library

Changeset 1069:b1b534ddb539 in lemon for test/CMakeLists.txt


Ignore:
Timestamp:
08/04/11 21:19:55 (8 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
1.1
Parents:
1064:40bbb450143e (diff), 1067:54464584b157 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge #382 to branch 1.1

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/CMakeLists.txt

    r1061 r1069  
    3232  heap_test
    3333  kruskal_test
     34  lgf_test
    3435  maps_test
    3536  matching_test
  • test/CMakeLists.txt

    r1067 r1069  
    11INCLUDE_DIRECTORIES(
    2   ${CMAKE_SOURCE_DIR}
     2  ${PROJECT_SOURCE_DIR}
    33  ${PROJECT_BINARY_DIR}
    44)
    55
    6 LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
     6LINK_DIRECTORIES(
     7  ${PROJECT_BINARY_DIR}/lemon
     8)
     9
     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.")
    713
    814SET(TESTS
     15  adaptors_test
    916  bfs_test
     17  circulation_test
     18  connectivity_test
    1019  counter_test
    1120  dfs_test
     
    1322  dijkstra_test
    1423  dim_test
     24  edge_set_test
    1525  error_test
     26  euler_test
     27  gomory_hu_test
    1628  graph_copy_test
    1729  graph_test
    1830  graph_utils_test
     31  hao_orlin_test
    1932  heap_test
    2033  kruskal_test
    2134  lgf_test
    2235  maps_test
     36  matching_test
     37  min_cost_arborescence_test
     38  min_cost_flow_test
     39  path_test
     40  preflow_test
     41  radix_sort_test
    2342  random_test
    24   path_test
     43  suurballe_test
    2544  time_measure_test
    26   unionfind_test)
     45  unionfind_test
     46)
     47
     48IF(LEMON_HAVE_LP)
     49  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     50    ADD_EXECUTABLE(lp_test lp_test.cc)
     51  ELSE()
     52    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     53  ENDIF()
     54
     55  SET(LP_TEST_LIBS lemon)
     56
     57  IF(LEMON_HAVE_GLPK)
     58    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
     59  ENDIF()
     60  IF(LEMON_HAVE_CPLEX)
     61    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
     62  ENDIF()
     63  IF(LEMON_HAVE_CLP)
     64    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
     65  ENDIF()
     66
     67  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
     68  ADD_TEST(lp_test lp_test)
     69  ADD_DEPENDENCIES(check lp_test)
     70
     71  IF(WIN32 AND LEMON_HAVE_GLPK)
     72    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
     73    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     74    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
     75      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
     76      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
     77      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
     78    )
     79  ENDIF()
     80
     81  IF(WIN32 AND LEMON_HAVE_CPLEX)
     82    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
     83    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
     84    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
     85      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     86    )
     87  ENDIF()
     88ENDIF()
     89
     90IF(LEMON_HAVE_MIP)
     91  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     92    ADD_EXECUTABLE(mip_test mip_test.cc)
     93  ELSE()
     94    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     95  ENDIF()
     96
     97  SET(MIP_TEST_LIBS lemon)
     98
     99  IF(LEMON_HAVE_GLPK)
     100    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
     101  ENDIF()
     102  IF(LEMON_HAVE_CPLEX)
     103    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
     104  ENDIF()
     105  IF(LEMON_HAVE_CBC)
     106    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
     107  ENDIF()
     108
     109  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
     110  ADD_TEST(mip_test mip_test)
     111  ADD_DEPENDENCIES(check mip_test)
     112
     113  IF(WIN32 AND LEMON_HAVE_GLPK)
     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
     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}
     120    )
     121  ENDIF()
     122
     123  IF(WIN32 AND LEMON_HAVE_CPLEX)
     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
     127      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
     128    )
     129  ENDIF()
     130ENDIF()
    27131
    28132FOREACH(TEST_NAME ${TESTS})
    29   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     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()
    30138  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    31   ADD_TEST(${TEST_NAME} ${TEST_NAME})
    32 ENDFOREACH(TEST_NAME)
     139    IF(TEST_WITH_VALGRIND)
     140      ADD_TEST(${TEST_NAME}
     141        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
     142        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
     143    ELSE()
     144      ADD_TEST(${TEST_NAME} ${TEST_NAME})
     145    ENDIF()
     146  ADD_DEPENDENCIES(check ${TEST_NAME})
     147ENDFOREACH()
Note: See TracChangeset for help on using the changeset viewer.