test/CMakeLists.txt
author Balazs Dezso <deba@inf.elte.hu>
Sat, 26 Sep 2009 10:17:31 +0200
changeset 870 61120524af27
parent 698 f9746e45246e
child 874 d8ea85825e02
permissions -rw-r--r--
Fractional matching initialization of weighted matchings (#314)
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
deba@490
    34
  min_cost_arborescence_test
kpeter@601
    35
  min_cost_flow_test
alpar@424
    36
  path_test
alpar@424
    37
  preflow_test
ladanyi@473
    38
  radix_sort_test
alpar@225
    39
  random_test
alpar@424
    40
  suurballe_test
ladanyi@141
    41
  time_measure_test
ladanyi@679
    42
  unionfind_test
ladanyi@679
    43
)
ladanyi@141
    44
ladanyi@627
    45
IF(LEMON_HAVE_LP)
ladanyi@473
    46
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@620
    47
  SET(LP_TEST_LIBS lemon)
ladanyi@679
    48
ladanyi@627
    49
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    50
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    51
  ENDIF()
ladanyi@627
    52
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    53
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    54
  ENDIF()
ladanyi@627
    55
  IF(LEMON_HAVE_CLP)
ladanyi@621
    56
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@679
    57
  ENDIF()
ladanyi@679
    58
ladanyi@620
    59
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    60
  ADD_TEST(lp_test lp_test)
ladanyi@473
    61
ladanyi@627
    62
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    63
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    64
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    65
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    66
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    67
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    68
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    69
    )
ladanyi@679
    70
  ENDIF()
ladanyi@679
    71
ladanyi@627
    72
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    73
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    74
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    75
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    76
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    77
    )
ladanyi@679
    78
  ENDIF()
ladanyi@679
    79
ENDIF()
ladanyi@473
    80
ladanyi@627
    81
IF(LEMON_HAVE_MIP)
ladanyi@473
    82
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@620
    83
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
    84
ladanyi@627
    85
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    86
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    87
  ENDIF()
ladanyi@627
    88
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    89
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    90
  ENDIF()
ladanyi@627
    91
  IF(LEMON_HAVE_CBC)
ladanyi@621
    92
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
    93
  ENDIF()
ladanyi@679
    94
ladanyi@620
    95
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
    96
  ADD_TEST(mip_test mip_test)
ladanyi@473
    97
ladanyi@627
    98
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    99
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   100
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   101
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   102
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   103
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   104
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   105
    )
ladanyi@679
   106
  ENDIF()
ladanyi@679
   107
ladanyi@627
   108
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   109
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   110
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   111
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   112
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   113
    )
ladanyi@679
   114
  ENDIF()
ladanyi@679
   115
ENDIF()
ladanyi@473
   116
alpar@225
   117
FOREACH(TEST_NAME ${TESTS})
alpar@225
   118
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   119
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   120
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@679
   121
ENDFOREACH()