test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 18 Mar 2010 13:18:58 +0100
changeset 878 d6052a9c4e8d
parent 797 30cb42e3e43a
parent 770 432c54cec63c
child 874 d8ea85825e02
permissions -rw-r--r--
Backed out changeset a6eb9698c321 (#360, #51)
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
tapolcai@543
    24
  gomory_hu_test
deba@200
    25
  graph_copy_test
ladanyi@141
    26
  graph_test
kpeter@171
    27
  graph_utils_test
deba@410
    28
  hao_orlin_test
deba@203
    29
  heap_test
ladanyi@141
    30
  kruskal_test
ladanyi@141
    31
  maps_test
kpeter@594
    32
  matching_test
deba@490
    33
  min_cost_arborescence_test
kpeter@601
    34
  min_cost_flow_test
kpeter@763
    35
  min_mean_cycle_test
alpar@424
    36
  path_test
deba@797
    37
  planarity_test
alpar@424
    38
  preflow_test
ladanyi@473
    39
  radix_sort_test
alpar@225
    40
  random_test
alpar@424
    41
  suurballe_test
ladanyi@141
    42
  time_measure_test
ladanyi@679
    43
  unionfind_test
ladanyi@679
    44
)
ladanyi@141
    45
ladanyi@627
    46
IF(LEMON_HAVE_LP)
ladanyi@473
    47
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@620
    48
  SET(LP_TEST_LIBS lemon)
ladanyi@679
    49
ladanyi@627
    50
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    51
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    52
  ENDIF()
ladanyi@627
    53
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    54
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    55
  ENDIF()
ladanyi@627
    56
  IF(LEMON_HAVE_CLP)
ladanyi@621
    57
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@679
    58
  ENDIF()
ladanyi@679
    59
ladanyi@620
    60
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    61
  ADD_TEST(lp_test lp_test)
ladanyi@473
    62
ladanyi@627
    63
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    64
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    65
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    66
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    67
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    68
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    69
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    70
    )
ladanyi@679
    71
  ENDIF()
ladanyi@679
    72
ladanyi@627
    73
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    74
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    75
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    76
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    77
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    78
    )
ladanyi@679
    79
  ENDIF()
ladanyi@679
    80
ENDIF()
ladanyi@473
    81
ladanyi@627
    82
IF(LEMON_HAVE_MIP)
ladanyi@473
    83
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@620
    84
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
    85
ladanyi@627
    86
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    87
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    88
  ENDIF()
ladanyi@627
    89
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    90
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    91
  ENDIF()
ladanyi@627
    92
  IF(LEMON_HAVE_CBC)
ladanyi@621
    93
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
    94
  ENDIF()
ladanyi@679
    95
ladanyi@620
    96
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
    97
  ADD_TEST(mip_test mip_test)
ladanyi@473
    98
ladanyi@627
    99
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   100
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   101
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   102
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   103
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   104
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   105
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   106
    )
ladanyi@679
   107
  ENDIF()
ladanyi@679
   108
ladanyi@627
   109
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   110
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   111
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   112
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   113
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   114
    )
ladanyi@679
   115
  ENDIF()
ladanyi@679
   116
ENDIF()
ladanyi@473
   117
alpar@225
   118
FOREACH(TEST_NAME ${TESTS})
alpar@225
   119
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   120
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   121
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@679
   122
ENDFOREACH()