test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Mon, 05 Apr 2010 23:41:05 +0200
changeset 883 dc376822c17d
parent 799 6be1f9bd2ac0
parent 869 636dadefe1e6
child 897 e20fecd1945f
child 904 c279b19abc62
child 964 2b6bffe0e7e8
permissions -rw-r--r--
Add an undirected() function (#364)
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
kpeter@763
    36
  min_mean_cycle_test
alpar@424
    37
  path_test
deba@797
    38
  planarity_test
alpar@424
    39
  preflow_test
ladanyi@473
    40
  radix_sort_test
alpar@225
    41
  random_test
alpar@424
    42
  suurballe_test
ladanyi@141
    43
  time_measure_test
ladanyi@679
    44
  unionfind_test
ladanyi@679
    45
)
ladanyi@141
    46
ladanyi@627
    47
IF(LEMON_HAVE_LP)
ladanyi@473
    48
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@620
    49
  SET(LP_TEST_LIBS lemon)
ladanyi@679
    50
ladanyi@627
    51
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    52
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    53
  ENDIF()
ladanyi@627
    54
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    55
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    56
  ENDIF()
ladanyi@627
    57
  IF(LEMON_HAVE_CLP)
ladanyi@621
    58
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@679
    59
  ENDIF()
ladanyi@679
    60
ladanyi@620
    61
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    62
  ADD_TEST(lp_test lp_test)
ladanyi@473
    63
ladanyi@627
    64
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    65
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    66
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    67
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    68
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    69
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    70
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    71
    )
ladanyi@679
    72
  ENDIF()
ladanyi@679
    73
ladanyi@627
    74
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    75
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    76
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    77
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    78
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    79
    )
ladanyi@679
    80
  ENDIF()
ladanyi@679
    81
ENDIF()
ladanyi@473
    82
ladanyi@627
    83
IF(LEMON_HAVE_MIP)
ladanyi@473
    84
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@620
    85
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
    86
ladanyi@627
    87
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    88
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    89
  ENDIF()
ladanyi@627
    90
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    91
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    92
  ENDIF()
ladanyi@627
    93
  IF(LEMON_HAVE_CBC)
ladanyi@621
    94
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
    95
  ENDIF()
ladanyi@679
    96
ladanyi@620
    97
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
    98
  ADD_TEST(mip_test mip_test)
ladanyi@473
    99
ladanyi@627
   100
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   101
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   102
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   103
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   104
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   105
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   106
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   107
    )
ladanyi@679
   108
  ENDIF()
ladanyi@679
   109
ladanyi@627
   110
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   111
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   112
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   113
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   114
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   115
    )
ladanyi@679
   116
  ENDIF()
ladanyi@679
   117
ENDIF()
ladanyi@473
   118
alpar@225
   119
FOREACH(TEST_NAME ${TESTS})
alpar@225
   120
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   121
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   122
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@679
   123
ENDFOREACH()