test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 18 Nov 2009 14:38:38 +0100
changeset 839 a2d5fd4c309a
parent 810 93cd93e82f9b
parent 745 f9746e45246e
child 863 6be1f9bd2ac0
permissions -rw-r--r--
Merge
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
tapolcai@590
    24
  gomory_hu_test
deba@200
    25
  graph_copy_test
ladanyi@141
    26
  graph_test
kpeter@171
    27
  graph_utils_test
deba@426
    28
  hao_orlin_test
deba@203
    29
  heap_test
ladanyi@141
    30
  kruskal_test
ladanyi@141
    31
  maps_test
kpeter@641
    32
  matching_test
deba@522
    33
  min_cost_arborescence_test
kpeter@648
    34
  min_cost_flow_test
kpeter@810
    35
  min_mean_cycle_test
alpar@443
    36
  path_test
alpar@443
    37
  preflow_test
ladanyi@496
    38
  radix_sort_test
alpar@225
    39
  random_test
alpar@443
    40
  suurballe_test
ladanyi@141
    41
  time_measure_test
ladanyi@726
    42
  unionfind_test
ladanyi@726
    43
)
ladanyi@141
    44
ladanyi@674
    45
IF(LEMON_HAVE_LP)
ladanyi@496
    46
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@667
    47
  SET(LP_TEST_LIBS lemon)
ladanyi@726
    48
ladanyi@674
    49
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    50
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    51
  ENDIF()
ladanyi@674
    52
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    53
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    54
  ENDIF()
ladanyi@674
    55
  IF(LEMON_HAVE_CLP)
ladanyi@668
    56
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@726
    57
  ENDIF()
ladanyi@726
    58
ladanyi@667
    59
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    60
  ADD_TEST(lp_test lp_test)
ladanyi@496
    61
ladanyi@674
    62
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    63
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    64
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    65
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    66
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
    67
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
    68
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    69
    )
ladanyi@726
    70
  ENDIF()
ladanyi@726
    71
ladanyi@674
    72
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    73
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    74
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    75
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    76
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    77
    )
ladanyi@726
    78
  ENDIF()
ladanyi@726
    79
ENDIF()
ladanyi@496
    80
ladanyi@674
    81
IF(LEMON_HAVE_MIP)
ladanyi@496
    82
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@667
    83
  SET(MIP_TEST_LIBS lemon)
ladanyi@726
    84
ladanyi@674
    85
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    86
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    87
  ENDIF()
ladanyi@674
    88
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    89
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    90
  ENDIF()
ladanyi@674
    91
  IF(LEMON_HAVE_CBC)
ladanyi@668
    92
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@726
    93
  ENDIF()
ladanyi@726
    94
ladanyi@667
    95
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
    96
  ADD_TEST(mip_test mip_test)
ladanyi@496
    97
ladanyi@674
    98
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    99
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
   100
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
   101
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   102
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
   103
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
   104
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
   105
    )
ladanyi@726
   106
  ENDIF()
ladanyi@726
   107
ladanyi@674
   108
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
   109
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
   110
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   111
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   112
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   113
    )
ladanyi@726
   114
  ENDIF()
ladanyi@726
   115
ENDIF()
ladanyi@496
   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@726
   121
ENDFOREACH()