test/CMakeLists.txt
author Alpar Juttner <alpar@cs.elte.hu>
Thu, 07 Apr 2011 16:57:35 +0200
changeset 749 64260c0f58eb
parent 681 9c7639f3a741
child 747 66156a3498ea
permissions -rw-r--r--
Better Win CodeBlock/MinGW support (#418)
- Remove -ansi compilation flag
- Don't include sys/times.h when WIN32 is defined
ladanyi@620
     1
INCLUDE_DIRECTORIES(
ladanyi@538
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@620
     3
  ${PROJECT_BINARY_DIR}
ladanyi@620
     4
)
ladanyi@141
     5
ladanyi@681
     6
LINK_DIRECTORIES(
ladanyi@681
     7
  ${PROJECT_BINARY_DIR}/lemon
ladanyi@681
     8
)
ladanyi@141
     9
alpar@225
    10
SET(TESTS
deba@488
    11
  adaptors_test
ladanyi@141
    12
  bfs_test
alpar@424
    13
  circulation_test
kpeter@647
    14
  connectivity_test
ladanyi@141
    15
  counter_test
ladanyi@141
    16
  dfs_test
ladanyi@141
    17
  digraph_test
kpeter@170
    18
  dijkstra_test
ladanyi@141
    19
  dim_test
deba@488
    20
  edge_set_test
ladanyi@141
    21
  error_test
ladanyi@506
    22
  euler_test
tapolcai@531
    23
  gomory_hu_test
deba@200
    24
  graph_copy_test
ladanyi@141
    25
  graph_test
kpeter@171
    26
  graph_utils_test
deba@410
    27
  hao_orlin_test
deba@203
    28
  heap_test
ladanyi@141
    29
  kruskal_test
ladanyi@141
    30
  maps_test
kpeter@586
    31
  matching_test
deba@512
    32
  min_cost_arborescence_test
kpeter@593
    33
  min_cost_flow_test
alpar@424
    34
  path_test
alpar@424
    35
  preflow_test
ladanyi@473
    36
  radix_sort_test
alpar@225
    37
  random_test
alpar@424
    38
  suurballe_test
ladanyi@141
    39
  time_measure_test
ladanyi@681
    40
  unionfind_test
ladanyi@681
    41
)
ladanyi@141
    42
ladanyi@622
    43
IF(LEMON_HAVE_LP)
alpar@742
    44
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@742
    45
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@742
    46
  ELSE()
alpar@742
    47
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@742
    48
  ENDIF()
alpar@742
    49
ladanyi@612
    50
  SET(LP_TEST_LIBS lemon)
ladanyi@681
    51
ladanyi@622
    52
  IF(LEMON_HAVE_GLPK)
ladanyi@612
    53
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@681
    54
  ENDIF()
ladanyi@622
    55
  IF(LEMON_HAVE_CPLEX)
ladanyi@612
    56
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@681
    57
  ENDIF()
ladanyi@622
    58
  IF(LEMON_HAVE_CLP)
ladanyi@613
    59
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@681
    60
  ENDIF()
ladanyi@681
    61
ladanyi@612
    62
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    63
  ADD_TEST(lp_test lp_test)
ladanyi@473
    64
ladanyi@622
    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@681
    69
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@681
    70
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@681
    71
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    72
    )
ladanyi@681
    73
  ENDIF()
ladanyi@681
    74
ladanyi@622
    75
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@612
    76
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@612
    77
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@612
    78
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@681
    79
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@612
    80
    )
ladanyi@681
    81
  ENDIF()
ladanyi@681
    82
ENDIF()
ladanyi@473
    83
ladanyi@622
    84
IF(LEMON_HAVE_MIP)
alpar@742
    85
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@742
    86
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@742
    87
  ELSE()
alpar@742
    88
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@742
    89
  ENDIF()
alpar@742
    90
ladanyi@612
    91
  SET(MIP_TEST_LIBS lemon)
ladanyi@681
    92
ladanyi@622
    93
  IF(LEMON_HAVE_GLPK)
ladanyi@612
    94
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@681
    95
  ENDIF()
ladanyi@622
    96
  IF(LEMON_HAVE_CPLEX)
ladanyi@612
    97
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@681
    98
  ENDIF()
ladanyi@622
    99
  IF(LEMON_HAVE_CBC)
ladanyi@613
   100
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@681
   101
  ENDIF()
ladanyi@681
   102
ladanyi@612
   103
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
   104
  ADD_TEST(mip_test mip_test)
ladanyi@473
   105
ladanyi@622
   106
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   107
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   108
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   109
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@681
   110
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@681
   111
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@681
   112
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   113
    )
ladanyi@681
   114
  ENDIF()
ladanyi@681
   115
ladanyi@622
   116
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@612
   117
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@612
   118
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@612
   119
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@681
   120
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@612
   121
    )
ladanyi@681
   122
  ENDIF()
ladanyi@681
   123
ENDIF()
ladanyi@473
   124
alpar@225
   125
FOREACH(TEST_NAME ${TESTS})
alpar@742
   126
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@742
   127
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@742
   128
  ELSE()
alpar@742
   129
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@742
   130
  ENDIF()
alpar@225
   131
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   132
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@742
   133
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@681
   134
ENDFOREACH()