test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Fri, 08 May 2009 13:15:29 +0200
changeset 654 a312f84d86c6
parent 627 20dac2104519
child 679 9c7639f3a741
permissions -rw-r--r--
Doc fixes for lgf-gen (#282)
ladanyi@499
     1
INCLUDE_DIRECTORIES(
ladanyi@549
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@499
     3
  ${PROJECT_BINARY_DIR}
ladanyi@499
     4
)
ladanyi@141
     5
ladanyi@549
     6
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
ladanyi@141
     7
alpar@225
     8
SET(TESTS
deba@512
     9
  adaptors_test
ladanyi@141
    10
  bfs_test
alpar@424
    11
  circulation_test
kpeter@649
    12
  connectivity_test
ladanyi@141
    13
  counter_test
ladanyi@141
    14
  dfs_test
ladanyi@141
    15
  digraph_test
kpeter@170
    16
  dijkstra_test
ladanyi@141
    17
  dim_test
deba@512
    18
  edge_set_test
ladanyi@141
    19
  error_test
ladanyi@522
    20
  euler_test
tapolcai@543
    21
  gomory_hu_test
deba@200
    22
  graph_copy_test
ladanyi@141
    23
  graph_test
kpeter@171
    24
  graph_utils_test
deba@410
    25
  hao_orlin_test
deba@203
    26
  heap_test
ladanyi@141
    27
  kruskal_test
ladanyi@141
    28
  maps_test
kpeter@594
    29
  matching_test
deba@490
    30
  min_cost_arborescence_test
kpeter@601
    31
  min_cost_flow_test
alpar@424
    32
  path_test
alpar@424
    33
  preflow_test
ladanyi@473
    34
  radix_sort_test
alpar@225
    35
  random_test
alpar@424
    36
  suurballe_test
ladanyi@141
    37
  time_measure_test
ladanyi@141
    38
  unionfind_test)
ladanyi@141
    39
ladanyi@627
    40
IF(LEMON_HAVE_LP)
ladanyi@473
    41
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@620
    42
  SET(LP_TEST_LIBS lemon)
ladanyi@627
    43
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    44
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@627
    45
  ENDIF(LEMON_HAVE_GLPK)
ladanyi@627
    46
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    47
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@627
    48
  ENDIF(LEMON_HAVE_CPLEX)
ladanyi@627
    49
  IF(LEMON_HAVE_CLP)
ladanyi@621
    50
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@627
    51
  ENDIF(LEMON_HAVE_CLP)
ladanyi@620
    52
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    53
  ADD_TEST(lp_test lp_test)
ladanyi@473
    54
ladanyi@627
    55
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    56
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    57
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    58
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@473
    59
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@473
    60
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@473
    61
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    62
    )
ladanyi@627
    63
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@627
    64
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    65
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    66
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    67
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@620
    68
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    69
    )
ladanyi@627
    70
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@627
    71
ENDIF(LEMON_HAVE_LP)
ladanyi@473
    72
ladanyi@627
    73
IF(LEMON_HAVE_MIP)
ladanyi@473
    74
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@620
    75
  SET(MIP_TEST_LIBS lemon)
ladanyi@627
    76
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    77
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@627
    78
  ENDIF(LEMON_HAVE_GLPK)
ladanyi@627
    79
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    80
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@627
    81
  ENDIF(LEMON_HAVE_CPLEX)
ladanyi@627
    82
  IF(LEMON_HAVE_CBC)
ladanyi@621
    83
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@627
    84
  ENDIF(LEMON_HAVE_CBC)
ladanyi@620
    85
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
    86
  ADD_TEST(mip_test mip_test)
ladanyi@473
    87
ladanyi@627
    88
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    89
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
    90
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    91
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@473
    92
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@473
    93
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@473
    94
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    95
    )
ladanyi@627
    96
  ENDIF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@627
    97
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    98
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
    99
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   100
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@620
   101
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   102
    )
ladanyi@627
   103
  ENDIF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@627
   104
ENDIF(LEMON_HAVE_MIP)
ladanyi@473
   105
alpar@225
   106
FOREACH(TEST_NAME ${TESTS})
alpar@225
   107
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   108
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   109
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@225
   110
ENDFOREACH(TEST_NAME)