diff --git a/canopen_fake_slaves/CMakeLists.txt b/canopen_fake_slaves/CMakeLists.txt index 7a3034c7..3297f9dd 100644 --- a/canopen_fake_slaves/CMakeLists.txt +++ b/canopen_fake_slaves/CMakeLists.txt @@ -12,6 +12,17 @@ find_package(lifecycle_msgs REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_lifecycle REQUIRED) +add_library( + motion_generator + SHARED + "src/motion_generator.cpp" +) +target_compile_features(motion_generator PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 +target_include_directories(motion_generator PUBLIC + $ + $) + + set(dependencies lely_core_libraries lifecycle_msgs @@ -38,7 +49,6 @@ ament_target_dependencies( add_executable( cia402_slave_node "src/cia402_slave.cpp" - "src/motion_generator.cpp" ) target_compile_features(cia402_slave_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 target_include_directories(cia402_slave_node PUBLIC @@ -50,6 +60,14 @@ ament_target_dependencies( ${dependencies} ) +target_link_libraries( + cia402_slave_node + motion_generator +) + +install(TARGETS motion_generator +DESTINATION lib/${PROJECT_NAME}) + install(TARGETS basic_slave_node DESTINATION lib/${PROJECT_NAME})