test/CMakeLists.txt
author Akos Ladanyi <ladanyi@tmit.bme.hu>
Wed, 05 Nov 2008 14:44:37 +0000
changeset 363 a637fb9d457b
parent 326 64ad48007fb2
child 410 eac19fb31a09
permissions -rw-r--r--
Revert to the canonical way of customizing CXXFLAGS

A default list of compiler flags is set via AM_CXXFLAGS Automake variable.
However this gets overridden by per-target CXXFLAGS variables (e.g.
foo_CXXFLAGS in case the foo target). Because of this you should append
$(AM_CXXFLAGS) to the end of the per-target CXXFLAGS variables (e.g.
foo_CXXFLAGS = ... $(AM_CXXFLAGS)).

After this default list of flags the contents of the CXXFLAGS user variable is
passed to the compiler. This variable has a default value determined by
configure (in case of g++ it is '-g -O2'). You can override this by specifying
CXXFLAGS when invoking make (e.g. make CXXFLAGS='-O3').
alpar@225
     1
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
ladanyi@141
     2
alpar@225
     3
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
ladanyi@141
     4
alpar@225
     5
SET(TESTS
ladanyi@141
     6
  bfs_test
ladanyi@141
     7
  counter_test
ladanyi@141
     8
  dfs_test
ladanyi@141
     9
  digraph_test
kpeter@170
    10
  dijkstra_test
ladanyi@141
    11
  dim_test
ladanyi@141
    12
  error_test
deba@200
    13
  graph_copy_test
ladanyi@141
    14
  graph_test
kpeter@171
    15
  graph_utils_test
deba@203
    16
  heap_test
ladanyi@141
    17
  kruskal_test
ladanyi@141
    18
  maps_test
deba@326
    19
  max_matching_test
alpar@225
    20
  random_test
kpeter@171
    21
  path_test
ladanyi@141
    22
  time_measure_test
ladanyi@141
    23
  unionfind_test)
ladanyi@141
    24
alpar@225
    25
FOREACH(TEST_NAME ${TESTS})
alpar@225
    26
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
    27
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
    28
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@225
    29
ENDFOREACH(TEST_NAME)