test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 22 Sep 2010 09:38:23 +0200
changeset 907 1937b6455b7d
parent 901 63e4468c680e
parent 904 c279b19abc62
child 909 48e29534cf03
child 913 5087694945e4
child 916 70bee017b584
permissions -rw-r--r--
Merge bugfix #392
ladanyi@510
     1
INCLUDE_DIRECTORIES(
ladanyi@549
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@510
     3
  ${PROJECT_BINARY_DIR}
ladanyi@510
     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@488
    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@488
    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
kpeter@904
    34
  max_clique_test
deba@501
    35
  min_cost_arborescence_test
kpeter@601
    36
  min_cost_flow_test
kpeter@763
    37
  min_mean_cycle_test
alpar@424
    38
  path_test
deba@797
    39
  planarity_test
alpar@424
    40
  preflow_test
ladanyi@473
    41
  radix_sort_test
alpar@225
    42
  random_test
alpar@424
    43
  suurballe_test
ladanyi@141
    44
  time_measure_test
ladanyi@679
    45
  unionfind_test
ladanyi@679
    46
)
ladanyi@141
    47
ladanyi@627
    48
IF(LEMON_HAVE_LP)
ladanyi@473
    49
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@620
    50
  SET(LP_TEST_LIBS lemon)
ladanyi@679
    51
ladanyi@627
    52
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    53
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    54
  ENDIF()
ladanyi@627
    55
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    56
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    57
  ENDIF()
ladanyi@627
    58
  IF(LEMON_HAVE_CLP)
ladanyi@621
    59
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@679
    60
  ENDIF()
ladanyi@679
    61
ladanyi@620
    62
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    63
  ADD_TEST(lp_test lp_test)
ladanyi@473
    64
ladanyi@627
    65
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    66
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    67
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    68
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    69
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    70
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    71
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    72
    )
ladanyi@679
    73
  ENDIF()
ladanyi@679
    74
ladanyi@627
    75
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    76
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    77
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    78
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    79
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
    80
    )
ladanyi@679
    81
  ENDIF()
ladanyi@679
    82
ENDIF()
ladanyi@473
    83
ladanyi@627
    84
IF(LEMON_HAVE_MIP)
ladanyi@473
    85
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@620
    86
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
    87
ladanyi@627
    88
  IF(LEMON_HAVE_GLPK)
ladanyi@620
    89
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
    90
  ENDIF()
ladanyi@627
    91
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
    92
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
    93
  ENDIF()
ladanyi@627
    94
  IF(LEMON_HAVE_CBC)
ladanyi@621
    95
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
    96
  ENDIF()
ladanyi@679
    97
ladanyi@620
    98
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
    99
  ADD_TEST(mip_test mip_test)
ladanyi@473
   100
ladanyi@627
   101
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   102
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   103
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   104
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   105
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   106
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   107
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   108
    )
ladanyi@679
   109
  ENDIF()
ladanyi@679
   110
ladanyi@627
   111
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   112
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   113
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   114
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   115
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@620
   116
    )
ladanyi@679
   117
  ENDIF()
ladanyi@679
   118
ENDIF()
ladanyi@473
   119
alpar@225
   120
FOREACH(TEST_NAME ${TESTS})
alpar@901
   121
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@901
   122
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@901
   123
  ELSE()
alpar@901
   124
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@901
   125
  ENDIF()
alpar@225
   126
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   127
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@897
   128
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@679
   129
ENDFOREACH()