test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 17 Mar 2011 09:16:38 +0100
branch1.2
changeset 1043 4e36fdf856b7
parent 953 d8ea85825e02
parent 1033 16d466589b54
child 1051 cc9bb4f95ed3
permissions -rw-r--r--
Merge bugfix in #417 to branch 1.2
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
deba@522
    34
  min_cost_arborescence_test
kpeter@648
    35
  min_cost_flow_test
kpeter@810
    36
  min_mean_cycle_test
alpar@443
    37
  path_test
deba@861
    38
  planarity_test
alpar@443
    39
  preflow_test
ladanyi@496
    40
  radix_sort_test
alpar@225
    41
  random_test
alpar@443
    42
  suurballe_test
ladanyi@141
    43
  time_measure_test
ladanyi@726
    44
  unionfind_test
ladanyi@726
    45
)
ladanyi@141
    46
ladanyi@674
    47
IF(LEMON_HAVE_LP)
alpar@1033
    48
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
    49
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@1033
    50
  ELSE()
alpar@1033
    51
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@1033
    52
  ENDIF()
alpar@1033
    53
ladanyi@667
    54
  SET(LP_TEST_LIBS lemon)
ladanyi@726
    55
ladanyi@674
    56
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    57
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    58
  ENDIF()
ladanyi@674
    59
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
    60
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
    61
  ENDIF()
ladanyi@674
    62
  IF(LEMON_HAVE_CLP)
ladanyi@668
    63
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@726
    64
  ENDIF()
ladanyi@726
    65
ladanyi@667
    66
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    67
  ADD_TEST(lp_test lp_test)
ladanyi@496
    68
ladanyi@674
    69
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    70
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    71
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    72
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    73
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
    74
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
    75
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    76
    )
ladanyi@726
    77
  ENDIF()
ladanyi@726
    78
ladanyi@674
    79
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    80
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    81
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    82
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    83
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    84
    )
ladanyi@726
    85
  ENDIF()
ladanyi@726
    86
ENDIF()
ladanyi@496
    87
ladanyi@674
    88
IF(LEMON_HAVE_MIP)
alpar@1033
    89
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
    90
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@1033
    91
  ELSE()
alpar@1033
    92
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@1033
    93
  ENDIF()
alpar@1033
    94
ladanyi@667
    95
  SET(MIP_TEST_LIBS lemon)
ladanyi@726
    96
ladanyi@674
    97
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    98
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    99
  ENDIF()
ladanyi@674
   100
  IF(LEMON_HAVE_CPLEX)
ladanyi@667
   101
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@726
   102
  ENDIF()
ladanyi@674
   103
  IF(LEMON_HAVE_CBC)
ladanyi@668
   104
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@726
   105
  ENDIF()
ladanyi@726
   106
ladanyi@667
   107
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
   108
  ADD_TEST(mip_test mip_test)
ladanyi@496
   109
ladanyi@674
   110
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
   111
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
   112
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
   113
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   114
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
   115
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
   116
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
   117
    )
ladanyi@726
   118
  ENDIF()
ladanyi@726
   119
ladanyi@674
   120
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
   121
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
   122
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   123
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   124
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   125
    )
ladanyi@726
   126
  ENDIF()
ladanyi@726
   127
ENDIF()
ladanyi@496
   128
alpar@225
   129
FOREACH(TEST_NAME ${TESTS})
alpar@1033
   130
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
   131
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@1033
   132
  ELSE()
alpar@1033
   133
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@1033
   134
  ENDIF()
alpar@225
   135
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   136
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@1033
   137
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@726
   138
ENDFOREACH()