test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Sun, 09 Jan 2011 23:20:56 +0100
changeset 1024 745312f9b441
parent 1020 70bee017b584
parent 1018 35ba7236bd67
child 1040 8e39ccaabf48
child 1203 07682e24c4e8
permissions -rw-r--r--
Improve the doc of path structures (#406)
ladanyi@539
     1
INCLUDE_DIRECTORIES(
ladanyi@596
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@539
     3
  ${PROJECT_BINARY_DIR}
ladanyi@539
     4
)
ladanyi@141
     5
ladanyi@726
     6
LINK_DIRECTORIES(
ladanyi@726
     7
  ${PROJECT_BINARY_DIR}/lemon
ladanyi@726
     8
)
ladanyi@141
     9
alpar@225
    10
SET(TESTS
deba@559
    11
  adaptors_test
kpeter@745
    12
  bellman_ford_test
ladanyi@141
    13
  bfs_test
alpar@443
    14
  circulation_test
kpeter@696
    15
  connectivity_test
ladanyi@141
    16
  counter_test
ladanyi@141
    17
  dfs_test
ladanyi@141
    18
  digraph_test
kpeter@170
    19
  dijkstra_test
ladanyi@141
    20
  dim_test
deba@559
    21
  edge_set_test
ladanyi@141
    22
  error_test
ladanyi@569
    23
  euler_test
deba@948
    24
  fractional_matching_test
tapolcai@590
    25
  gomory_hu_test
deba@200
    26
  graph_copy_test
ladanyi@141
    27
  graph_test
kpeter@171
    28
  graph_utils_test
deba@426
    29
  hao_orlin_test
deba@203
    30
  heap_test
ladanyi@141
    31
  kruskal_test
ladanyi@141
    32
  maps_test
kpeter@641
    33
  matching_test
thoneyvazul@1020
    34
  max_cardinality_search_test
kpeter@999
    35
  max_clique_test
deba@522
    36
  min_cost_arborescence_test
kpeter@648
    37
  min_cost_flow_test
kpeter@810
    38
  min_mean_cycle_test
deba@1017
    39
  nagamochi_ibaraki_test
alpar@443
    40
  path_test
deba@861
    41
  planarity_test
alpar@443
    42
  preflow_test
ladanyi@496
    43
  radix_sort_test
alpar@225
    44
  random_test
alpar@443
    45
  suurballe_test
ladanyi@141
    46
  time_measure_test
ladanyi@726
    47
  unionfind_test
ladanyi@726
    48
)
ladanyi@141
    49
ladanyi@674
    50
IF(LEMON_HAVE_LP)
alpar@1013
    51
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1013
    52
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@1013
    53
  ELSE()
alpar@1013
    54
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@1013
    55
  ENDIF()
alpar@1013
    56
ladanyi@667
    57
  SET(LP_TEST_LIBS lemon)
ladanyi@726
    58
ladanyi@674
    59
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    60
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    61
  ENDIF()
ladanyi@674
    62
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    63
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    64
  ENDIF()
ladanyi@674
    65
  IF(LEMON_HAVE_CLP)
ladanyi@668
    66
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@726
    67
  ENDIF()
ladanyi@726
    68
ladanyi@667
    69
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    70
  ADD_TEST(lp_test lp_test)
ladanyi@496
    71
ladanyi@674
    72
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    73
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    74
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    75
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    76
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
    77
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
    78
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    79
    )
ladanyi@726
    80
  ENDIF()
ladanyi@726
    81
ladanyi@674
    82
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    83
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    84
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    85
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    86
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    87
    )
ladanyi@726
    88
  ENDIF()
ladanyi@726
    89
ENDIF()
ladanyi@496
    90
ladanyi@674
    91
IF(LEMON_HAVE_MIP)
alpar@1013
    92
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1013
    93
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@1013
    94
  ELSE()
alpar@1013
    95
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@1013
    96
  ENDIF()
alpar@1013
    97
ladanyi@667
    98
  SET(MIP_TEST_LIBS lemon)
ladanyi@726
    99
ladanyi@674
   100
  IF(LEMON_HAVE_GLPK)
ladanyi@667
   101
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
   102
  ENDIF()
ladanyi@674
   103
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
   104
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
   105
  ENDIF()
ladanyi@674
   106
  IF(LEMON_HAVE_CBC)
ladanyi@668
   107
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@726
   108
  ENDIF()
ladanyi@726
   109
ladanyi@667
   110
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
   111
  ADD_TEST(mip_test mip_test)
ladanyi@496
   112
ladanyi@674
   113
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
   114
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
   115
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
   116
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   117
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
   118
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
   119
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
   120
    )
ladanyi@726
   121
  ENDIF()
ladanyi@726
   122
ladanyi@674
   123
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
   124
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
   125
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   126
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   127
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   128
    )
ladanyi@726
   129
  ENDIF()
ladanyi@726
   130
ENDIF()
ladanyi@496
   131
alpar@225
   132
FOREACH(TEST_NAME ${TESTS})
alpar@996
   133
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@996
   134
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@996
   135
  ELSE()
alpar@996
   136
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@996
   137
  ENDIF()
alpar@225
   138
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   139
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@992
   140
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@726
   141
ENDFOREACH()