Skip to content

Commit

Permalink
creating compatibility between catkin and cmake for calling unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markusgft committed May 16, 2019
1 parent 811f079 commit 464d8d9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ct_core/test/CMakeLists.txt
Expand Up @@ -40,3 +40,10 @@ add_custom_command(TARGET run_tests
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

## install tests
include(GNUInstallDirs)
install(
TARGETS ${UNIT_TEST_TARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_core
)
7 changes: 7 additions & 0 deletions ct_models/test/CMakeLists.txt
Expand Up @@ -29,4 +29,11 @@ add_custom_command(TARGET run_tests
COMMENT "Running tests"
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

## install tests
include(GNUInstallDirs)
install(
TARGETS ${UNIT_TEST_TARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_models
)
3 changes: 0 additions & 3 deletions ct_optcon/CMakeLists.txt
Expand Up @@ -17,9 +17,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
## find and include required dependencies
find_package(ct_core REQUIRED)

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


## find and include optional dependencies
option(MATLAB "Compile with matlab support" OFF)
Expand Down
7 changes: 7 additions & 0 deletions ct_optcon/test/CMakeLists.txt
Expand Up @@ -81,4 +81,11 @@ add_custom_command(TARGET run_tests
COMMENT "Running tests"
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

## install tests
include(GNUInstallDirs)
install(
TARGETS ${UNIT_TEST_TARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_optcon
)
7 changes: 7 additions & 0 deletions ct_rbd/test/CMakeLists.txt
Expand Up @@ -63,4 +63,11 @@ add_custom_command(TARGET run_tests
COMMENT "Running tests"
POST_BUILD COMMAND ${PROJECT_SOURCE_DIR}/test/run_tests.py ${CMAKE_CURRENT_BINARY_DIR} ${UNIT_TEST_TARGETS}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

## install tests
include(GNUInstallDirs)
install(
TARGETS ${UNIT_TEST_TARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/ct_rbd
)

0 comments on commit 464d8d9

Please sign in to comment.