CMakeLists.txt 2.3 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright 2010, Olivier Stasse, JRL, CNRS/AIST
#
# This file is part of dynamic-graph.
# dynamic-graph is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# dynamic-graph is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Lesser Public License for more details.  You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.

ADD_DEFINITIONS(-DDEBUG=2)

# Add Boost path to include directories.
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)

Thomas Moulard's avatar
Thomas Moulard committed
24
ADD_DEFINITIONS(-DTESTS_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
25
ADD_DEFINITIONS(-DTESTS_PLUGINDIR="${LIBRARY_OUTPUT_PATH}")
26
ADD_DEFINITIONS(-DTESTS_DYNLIBSUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
Thomas Moulard's avatar
Thomas Moulard committed
27

Thomas Moulard's avatar
Thomas Moulard committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# DYNAMIC_GRAPH_TEST(NAME)
# ------------------------
#
# Define a test named `NAME'.
#
# This macro will create a binary from `NAME.cpp', link it against
# Boost and add it to the test suite.
#
MACRO(DYNAMIC_GRAPH_TEST NAME)
  ADD_EXECUTABLE(${NAME} ${NAME}.cpp)
  ADD_TEST(${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${NAME})

  TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME})
  ADD_DEPENDENCIES(${NAME} ${PROJECT_NAME})

  # Link against Boost.
  TARGET_LINK_LIBRARIES(${NAME} ${Boost_LIBRARIES})
Thomas Moulard's avatar
Thomas Moulard committed
45

Thomas Moulard's avatar
Thomas Moulard committed
46
47
48
49
ENDMACRO(DYNAMIC_GRAPH_TEST)


# Signal cast test.
50
SET(signalcast_libs signal-cast-registerer-libA signal-cast-registerer-libB)
Thomas Moulard's avatar
Thomas Moulard committed
51
52
53
54
55
56
57

FOREACH(lib ${signalcast_libs})
  ADD_LIBRARY(${lib} SHARED ${lib}.cpp)

  TARGET_LINK_LIBRARIES(${lib} ${PROJECT_NAME})
  ADD_DEPENDENCIES(${lib} ${PROJECT_NAME})
ENDFOREACH()
58
DYNAMIC_GRAPH_TEST(signal-cast-registerer)
59
60

# Unit testing.
Francois Keith's avatar
Francois Keith committed
61
62
63
IF(NOT APPLE)
  DYNAMIC_GRAPH_TEST(entity)
ENDIF(NOT APPLE)
Thomas Moulard's avatar
Thomas Moulard committed
64
DYNAMIC_GRAPH_TEST(custom-entity)
65
DYNAMIC_GRAPH_TEST(factory)
66
DYNAMIC_GRAPH_TEST(pool)
Thomas Moulard's avatar
Thomas Moulard committed
67
DYNAMIC_GRAPH_TEST(signal-time-dependent)
Thomas Moulard's avatar
Thomas Moulard committed
68
DYNAMIC_GRAPH_TEST(value)
69
DYNAMIC_GRAPH_TEST(signal-ptr)
Joseph Mirabel's avatar
Joseph Mirabel committed
70
DYNAMIC_GRAPH_TEST(real-time-logger)
71
DYNAMIC_GRAPH_TEST(debug-trace)