diff --git a/canopen_fake_slaves/CMakeLists.txt b/canopen_fake_slaves/CMakeLists.txt index 7a3034c7..2c6229e3 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_generaor + SHARED + "src/motion_generator.cpp" +) +target_compile_features(motion_generaor PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 +target_include_directories(motion_generaor 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 @@ -47,9 +57,13 @@ target_include_directories(cia402_slave_node PUBLIC ament_target_dependencies( cia402_slave_node + motion_generaor ${dependencies} ) +install(TARGETS motion_generaor +DESTINATION lib/${PROJECT_NAME}) + install(TARGETS basic_slave_node DESTINATION lib/${PROJECT_NAME})