test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Wed, 22 Sep 2010 09:38:23 +0200
changeset 1011 1937b6455b7d
parent 996 63e4468c680e
parent 999 c279b19abc62
child 1013 48e29534cf03
child 1017 5087694945e4
child 1020 70bee017b584
permissions -rw-r--r--
Merge bugfix #392
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
deba@948
    24
  fractional_matching_test
tapolcai@590
    25
  gomory_hu_test
deba@200
    26
  graph_copy_test
ladanyi@141
    27
  graph_test
kpeter@171
    28
  graph_utils_test
deba@426
    29
  hao_orlin_test
deba@203
    30
  heap_test
ladanyi@141
    31
  kruskal_test
ladanyi@141
    32
  maps_test
kpeter@641
    33
  matching_test
kpeter@999
    34
  max_clique_test
deba@522
    35
  min_cost_arborescence_test
kpeter@648
    36
  min_cost_flow_test
kpeter@810
    37
  min_mean_cycle_test
alpar@443
    38
  path_test
deba@861
    39
  planarity_test
alpar@443
    40
  preflow_test
ladanyi@496
    41
  radix_sort_test
alpar@225
    42
  random_test
alpar@443
    43
  suurballe_test
ladanyi@141
    44
  time_measure_test
ladanyi@726
    45
  unionfind_test
ladanyi@726
    46
)
ladanyi@141
    47
ladanyi@674
    48
IF(LEMON_HAVE_LP)
ladanyi@496
    49
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@667
    50
  SET(LP_TEST_LIBS lemon)
ladanyi@726
    51
ladanyi@674
    52
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    53
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    54
  ENDIF()
ladanyi@674
    55
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    56
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    57
  ENDIF()
ladanyi@674
    58
  IF(LEMON_HAVE_CLP)
ladanyi@668
    59
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@726
    60
  ENDIF()
ladanyi@726
    61
ladanyi@667
    62
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    63
  ADD_TEST(lp_test lp_test)
ladanyi@496
    64
ladanyi@674
    65
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    66
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    67
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    68
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    69
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
    70
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
    71
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    72
    )
ladanyi@726
    73
  ENDIF()
ladanyi@726
    74
ladanyi@674
    75
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    76
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    77
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    78
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    79
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    80
    )
ladanyi@726
    81
  ENDIF()
ladanyi@726
    82
ENDIF()
ladanyi@496
    83
ladanyi@674
    84
IF(LEMON_HAVE_MIP)
ladanyi@496
    85
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@667
    86
  SET(MIP_TEST_LIBS lemon)
ladanyi@726
    87
ladanyi@674
    88
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    89
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    90
  ENDIF()
ladanyi@674
    91
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    92
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    93
  ENDIF()
ladanyi@674
    94
  IF(LEMON_HAVE_CBC)
ladanyi@668
    95
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@726
    96
  ENDIF()
ladanyi@726
    97
ladanyi@667
    98
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
    99
  ADD_TEST(mip_test mip_test)
ladanyi@496
   100
ladanyi@674
   101
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
   102
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
   103
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
   104
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   105
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
   106
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
   107
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
   108
    )
ladanyi@726
   109
  ENDIF()
ladanyi@726
   110
ladanyi@674
   111
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
   112
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
   113
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   114
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   115
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   116
    )
ladanyi@726
   117
  ENDIF()
ladanyi@726
   118
ENDIF()
ladanyi@496
   119
alpar@225
   120
FOREACH(TEST_NAME ${TESTS})
alpar@996
   121
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@996
   122
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@996
   123
  ELSE()
alpar@996
   124
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@996
   125
  ENDIF()
alpar@225
   126
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   127
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
ladanyi@992
   128
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@726
   129
ENDFOREACH()