-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAddUnitTest.cmake
26 lines (22 loc) · 1.1 KB
/
AddUnitTest.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
MACRO( ADD_UNIT_TEST TEST_NAME TEST_LIST LIBS)
ADD_EXECUTABLE( ${TEST_NAME} test-runner.cpp ${TEST_NAME}.cpp ${ARGN} )
TARGET_LINK_LIBRARIES( ${TEST_NAME} orocos-rtt-${OROCOS_TARGET}_dynamic
${LIBS})
SET_TARGET_PROPERTIES( ${TEST_NAME} PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS_ADD}"
LINK_FLAGS "${CMAKE_LD_FLAGS_ADD}"
COMPILE_DEFINITIONS "${COMPILE_DEFS}" )
ADD_TEST( ${TEST_NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${TEST_NAME})
list(APPEND ${TEST_LIST} ${TEST_NAME})
ENDMACRO(ADD_UNIT_TEST TEST_NAME TEST_LIST LIBS)
MACRO( ADD_SIMPLE_TEST TEST_NAME TEST_LIST LIBS)
ADD_EXECUTABLE( ${TEST_NAME} ${TEST_NAME}.cpp ${ARGN} )
TARGET_LINK_LIBRARIES( ${TEST_NAME} orocos-rtt-${OROCOS_TARGET}_dynamic
${LIBS})
SET_TARGET_PROPERTIES( ${TEST_NAME} PROPERTIES
COMPILE_FLAGS "${CMAKE_CXX_FLAGS_ADD}"
LINK_FLAGS "${CMAKE_LD_FLAGS_ADD}"
COMPILE_DEFINITIONS "${COMPILE_DEFS}" )
ADD_TEST( ${TEST_NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${TEST_NAME})
list(APPEND ${TEST_LIST} ${TEST_NAME})
ENDMACRO(ADD_SIMPLE_TEST TEST_NAME TEST_LIST LIBS)