1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-23 04:04:54 +08:00

Merge branch 'ament_cmake'

This commit is contained in:
Dan Rose 2020-09-03 19:45:41 -05:00
commit 8e0effcd36
No known key found for this signature in database
GPG Key ID: 75E06FF4E527321C
3 changed files with 17 additions and 10 deletions

View File

@ -54,13 +54,17 @@ install(TARGETS ${PROJECT_NAME}
)
## Install headers
install(FILES include/serial/serial.h include/serial/v8stdint.h
install(
FILES include/serial/serial.h include/serial/v8stdint.h
DESTINATION include/serial
)
## Tests
#if(BUILD_TESTING)
# add_subdirectory(tests)
#endif()
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_package()

View File

@ -21,10 +21,10 @@
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_cmake_gtest</test_depend>
<test_depend>boost</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>

View File

@ -1,12 +1,15 @@
if(UNIX)
catkin_add_gtest(${PROJECT_NAME}-test unix_serial_tests.cc)
find_package(ament_cmake_gtest REQUIRED)
find_package(Boost REQUIRED)
ament_add_gtest(${PROJECT_NAME}-test unix_serial_tests.cc)
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${Boost_LIBRARIES})
if(NOT APPLE)
target_link_libraries(${PROJECT_NAME}-test util)
endif()
if(NOT APPLE) # these tests are unreliable on macOS
catkin_add_gtest(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc)
ament_add_gtest(${PROJECT_NAME}-test-timer unit/unix_timer_tests.cc)
target_link_libraries(${PROJECT_NAME}-test-timer ${PROJECT_NAME})
endif()
endif()