diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dc6c66..6a4bb58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ elseif(WIN32) # Windows src/impl/win.cc src/impl/list_ports/list_ports_win.cc ) - target_link_libraries(${PROJECT_NAME} setupapi) + target_link_libraries(${PROJECT_NAME} setupapi) ament_export_libraries(setupapi) endif() @@ -54,13 +54,17 @@ install(TARGETS ${PROJECT_NAME} ) ## Install headers -install(FILES include/serial/serial.h include/serial/v8stdint.h - DESTINATION include/serial +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() diff --git a/package.xml b/package.xml index f1ac9d3..7fb772d 100644 --- a/package.xml +++ b/package.xml @@ -21,10 +21,10 @@ ament_cmake + ament_cmake_gtest boost - ament_cmake + ament_cmake - diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e52a4d3..964f27c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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()