Skip to content

Commit 464d8d9

Browse files
committed
creating compatibility between catkin and cmake for calling unit tests
1 parent 811f079 commit 464d8d9

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

ct_core/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@ add_custom_command(TARGET run_tests
4040
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
4141
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
4242
)
43+
44+
## install tests
45+
include(GNUInstallDirs)
46+
install(
47+
TARGETS ${UNIT_TEST_TARGETS}
48+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_core
49+
)

ct_models/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ add_custom_command(TARGET run_tests
2929
COMMENT "Running tests"
3030
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
3131
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
32+
)
33+
34+
## install tests
35+
include(GNUInstallDirs)
36+
install(
37+
TARGETS ${UNIT_TEST_TARGETS}
38+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_models
3239
)

ct_optcon/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
1717
## find and include required dependencies
1818
find_package(ct_core REQUIRED)
1919

20-
## add compiler definitions exported by ct_core
21-
add_definitions(${ct_core_COMPILE_DEFINITIONS}) #todo this should ultimately go away
22-
2320

2421
## find and include optional dependencies
2522
option(MATLAB "Compile with matlab support" OFF)

ct_optcon/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,11 @@ add_custom_command(TARGET run_tests
8181
COMMENT "Running tests"
8282
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
8383
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
84+
)
85+
86+
## install tests
87+
include(GNUInstallDirs)
88+
install(
89+
TARGETS ${UNIT_TEST_TARGETS}
90+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_optcon
8491
)

ct_rbd/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,11 @@ add_custom_command(TARGET run_tests
6363
COMMENT "Running tests"
6464
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
6565
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
66+
)
67+
68+
## install tests
69+
include(GNUInstallDirs)
70+
install(
71+
TARGETS ${UNIT_TEST_TARGETS}
72+
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_rbd
6673
)

0 commit comments

Comments
 (0)