test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Sun, 09 Jan 2011 15:06:55 +0100
changeset 1036 dff32ce3db71
parent 917 4980b05606bd
child 1038 a2d142bb5d3c
permissions -rw-r--r--
Make InsertionTsp much faster and improve docs (#386)
ladanyi@499
     1
INCLUDE_DIRECTORIES(
ladanyi@549
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@499
     3
  ${PROJECT_BINARY_DIR}
ladanyi@499
     4
)
ladanyi@141
     5
ladanyi@679
     6
LINK_DIRECTORIES(
ladanyi@679
     7
  ${PROJECT_BINARY_DIR}/lemon
ladanyi@679
     8
)
ladanyi@141
     9
alpar@225
    10
SET(TESTS
deba@512
    11
  adaptors_test
kpeter@698
    12
  bellman_ford_test
ladanyi@141
    13
  bfs_test
alpar@424
    14
  circulation_test
kpeter@649
    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@512
    21
  edge_set_test
ladanyi@141
    22
  error_test
ladanyi@522
    23
  euler_test
deba@869
    24
  fractional_matching_test
tapolcai@543
    25
  gomory_hu_test
deba@200
    26
  graph_copy_test
ladanyi@141
    27
  graph_test
kpeter@171
    28
  graph_utils_test
deba@410
    29
  hao_orlin_test
deba@203
    30
  heap_test
ladanyi@141
    31
  kruskal_test
ladanyi@141
    32
  maps_test
kpeter@594
    33
  matching_test
thoneyvazul@916
    34
  max_cardinality_search_test
kpeter@904
    35
  max_clique_test
deba@490
    36
  min_cost_arborescence_test
kpeter@601
    37
  min_cost_flow_test
kpeter@763
    38
  min_mean_cycle_test
deba@913
    39
  nagamochi_ibaraki_test
alpar@424
    40
  path_test
deba@797
    41
  planarity_test
alpar@424
    42
  preflow_test
ladanyi@473
    43
  radix_sort_test
alpar@225
    44
  random_test
alpar@424
    45
  suurballe_test
ladanyi@141
    46
  time_measure_test
kpeter@1035
    47
  tsp_test
ladanyi@679
    48
  unionfind_test
ladanyi@679
    49
)
ladanyi@141
    50
ladanyi@627
    51
IF(LEMON_HAVE_LP)
alpar@909
    52
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@909
    53
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@909
    54
  ELSE()
alpar@909
    55
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@909
    56
  ENDIF()
alpar@909
    57
ladanyi@620
    58
  SET(LP_TEST_LIBS lemon)
ladanyi@679
    59
ladanyi@627
    60
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    61
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    62
  ENDIF()
ladanyi@627
    63
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    64
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    65
  ENDIF()
ladanyi@627
    66
  IF(LEMON_HAVE_CLP)
ladanyi@621
    67
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@679
    68
  ENDIF()
ladanyi@679
    69
ladanyi@620
    70
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    71
  ADD_TEST(lp_test lp_test)
ladanyi@473
    72
ladanyi@627
    73
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    74
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    75
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    76
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    77
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    78
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    79
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    80
    )
ladanyi@679
    81
  ENDIF()
ladanyi@679
    82
ladanyi@627
    83
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    84
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    85
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    86
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    87
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    88
    )
ladanyi@679
    89
  ENDIF()
ladanyi@679
    90
ENDIF()
ladanyi@473
    91
ladanyi@627
    92
IF(LEMON_HAVE_MIP)
alpar@909
    93
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@909
    94
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@909
    95
  ELSE()
alpar@909
    96
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@909
    97
  ENDIF()
alpar@909
    98
ladanyi@620
    99
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
   100
ladanyi@627
   101
  IF(LEMON_HAVE_GLPK)
ladanyi@620
   102
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
   103
  ENDIF()
ladanyi@627
   104
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
   105
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
   106
  ENDIF()
ladanyi@627
   107
  IF(LEMON_HAVE_CBC)
ladanyi@621
   108
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
   109
  ENDIF()
ladanyi@679
   110
ladanyi@620
   111
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
   112
  ADD_TEST(mip_test mip_test)
ladanyi@473
   113
ladanyi@627
   114
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   115
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   116
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   117
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   118
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   119
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   120
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   121
    )
ladanyi@679
   122
  ENDIF()
ladanyi@679
   123
ladanyi@627
   124
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   125
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   126
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   127
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   128
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   129
    )
ladanyi@679
   130
  ENDIF()
ladanyi@679
   131
ENDIF()
ladanyi@473
   132
alpar@225
   133
FOREACH(TEST_NAME ${TESTS})
alpar@901
   134
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@901
   135
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@901
   136
  ELSE()
alpar@901
   137
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@901
   138
  ENDIF()
alpar@225
   139
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   140
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@897
   141
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@679
   142
ENDFOREACH()