test/CMakeLists.txt
author Akos Ladanyi <ladanyi@tmit.bme.hu>
Tue, 28 Apr 2009 16:49:57 +0100
changeset 677 936355864d6e
parent 668 b536eaacb39b
parent 539 d8ca76573eb3
child 696 76cbcb3e9bbb
permissions -rw-r--r--
Add cbc.h to lemon/Makefile.am (#279)
ladanyi@539
     1
INCLUDE_DIRECTORIES(
ladanyi@596
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@539
     3
  ${PROJECT_BINARY_DIR}
ladanyi@539
     4
)
ladanyi@141
     5
ladanyi@596
     6
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
ladanyi@141
     7
alpar@225
     8
SET(TESTS
deba@559
     9
  adaptors_test
ladanyi@141
    10
  bfs_test
alpar@443
    11
  circulation_test
ladanyi@141
    12
  counter_test
ladanyi@141
    13
  dfs_test
ladanyi@141
    14
  digraph_test
kpeter@170
    15
  dijkstra_test
ladanyi@141
    16
  dim_test
deba@559
    17
  edge_set_test
ladanyi@141
    18
  error_test
ladanyi@569
    19
  euler_test
tapolcai@590
    20
  gomory_hu_test
deba@200
    21
  graph_copy_test
ladanyi@141
    22
  graph_test
kpeter@171
    23
  graph_utils_test
deba@426
    24
  hao_orlin_test
deba@203
    25
  heap_test
ladanyi@141
    26
  kruskal_test
ladanyi@141
    27
  maps_test
kpeter@641
    28
  matching_test
deba@522
    29
  min_cost_arborescence_test
kpeter@648
    30
  min_cost_flow_test
alpar@443
    31
  path_test
alpar@443
    32
  preflow_test
ladanyi@496
    33
  radix_sort_test
alpar@225
    34
  random_test
alpar@443
    35
  suurballe_test
ladanyi@141
    36
  time_measure_test
ladanyi@141
    37
  unionfind_test)
ladanyi@141
    38
ladanyi@674
    39
IF(LEMON_HAVE_LP)
ladanyi@496
    40
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@667
    41
  SET(LP_TEST_LIBS lemon)
ladanyi@674
    42
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    43
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@674
    44
  ENDIF(LEMON_HAVE_GLPK)
ladanyi@674
    45
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    46
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@674
    47
  ENDIF(LEMON_HAVE_CPLEX)
ladanyi@674
    48
  IF(LEMON_HAVE_CLP)
ladanyi@668
    49
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@674
    50
  ENDIF(LEMON_HAVE_CLP)
ladanyi@667
    51
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    52
  ADD_TEST(lp_test lp_test)
ladanyi@496
    53
ladanyi@674
    54
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    55
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    56
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    57
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@496
    58
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@496
    59
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@496
    60
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    61
    )
ladanyi@674
    62
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@674
    63
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    64
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    65
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    66
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@667
    67
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    68
    )
ladanyi@674
    69
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@674
    70
ENDIF(LEMON_HAVE_LP)
ladanyi@496
    71
ladanyi@674
    72
IF(LEMON_HAVE_MIP)
ladanyi@496
    73
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@667
    74
  SET(MIP_TEST_LIBS lemon)
ladanyi@674
    75
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    76
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@674
    77
  ENDIF(LEMON_HAVE_GLPK)
ladanyi@674
    78
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    79
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@674
    80
  ENDIF(LEMON_HAVE_CPLEX)
ladanyi@674
    81
  IF(LEMON_HAVE_CBC)
ladanyi@668
    82
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@674
    83
  ENDIF(LEMON_HAVE_CBC)
ladanyi@667
    84
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
    85
  ADD_TEST(mip_test mip_test)
ladanyi@496
    86
ladanyi@674
    87
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    88
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
    89
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    90
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@496
    91
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@496
    92
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@496
    93
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    94
    )
ladanyi@674
    95
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@674
    96
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    97
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
    98
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    99
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@667
   100
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   101
    )
ladanyi@674
   102
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@674
   103
ENDIF(LEMON_HAVE_MIP)
ladanyi@496
   104
alpar@225
   105
FOREACH(TEST_NAME ${TESTS})
alpar@225
   106
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   107
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   108
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@225
   109
ENDFOREACH(TEST_NAME)