diff --git a/CMakeLists.txt b/CMakeLists.txt index f12380ee..2a99c768 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,18 @@ set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR}) gz_find_package(gz-msgs10 REQUIRED) set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR}) +# Get the gz-msgs installed messages and generate a library from them +gz_msgs_get_installed_messages( + MESSAGES_PATH_VARIABLE MSGS_PATH + MESSAGES_PROTOS_VARIABLE MSGS_PROTOS) + +gz_msgs_generate_messages( + TARGET gz_msgs_gen + PROTO_PACKAGE "gz.msgs" + MSGS_PATH ${MSGS_PATH} + MSGS_PROTOS ${MSGS_PROTOS}) + + #-------------------------------------- # Find gz-math gz_find_package(gz-math7 REQUIRED) diff --git a/plugins/joy_to_twist/CMakeLists.txt b/plugins/joy_to_twist/CMakeLists.txt index ca374032..6e8f7fa1 100644 --- a/plugins/joy_to_twist/CMakeLists.txt +++ b/plugins/joy_to_twist/CMakeLists.txt @@ -9,6 +9,7 @@ target_link_libraries(${plugin} gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER} gz-plugin${GZ_PLUGIN_VER}::core gz-transport${GZ_TRANSPORT_VER}::core + gz_msgs_gen ) install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/joystick/CMakeLists.txt b/plugins/joystick/CMakeLists.txt index 71a3f359..fdc5854c 100644 --- a/plugins/joystick/CMakeLists.txt +++ b/plugins/joystick/CMakeLists.txt @@ -9,6 +9,7 @@ target_link_libraries(${plugin} gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER} gz-transport${GZ_TRANSPORT_VER}::core gz-plugin${GZ_PLUGIN_VER}::core + gz_msgs_gen ) install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/sim_factory/CMakeLists.txt b/plugins/sim_factory/CMakeLists.txt index e292621b..292e776e 100644 --- a/plugins/sim_factory/CMakeLists.txt +++ b/plugins/sim_factory/CMakeLists.txt @@ -11,6 +11,7 @@ target_link_libraries(${plugin_lower} gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} gz-transport${GZ_TRANSPORT_VER}::core gz-plugin${GZ_PLUGIN_VER}::core + gz_msgs_gen ) install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH}) diff --git a/plugins/sim_factory/SimFactory.cc b/plugins/sim_factory/SimFactory.cc index 600a7df9..c42428cd 100644 --- a/plugins/sim_factory/SimFactory.cc +++ b/plugins/sim_factory/SimFactory.cc @@ -17,6 +17,7 @@ #include #include +#include #include #include diff --git a/plugins/sim_server/CMakeLists.txt b/plugins/sim_server/CMakeLists.txt index f27edce3..d0271633 100644 --- a/plugins/sim_server/CMakeLists.txt +++ b/plugins/sim_server/CMakeLists.txt @@ -11,6 +11,7 @@ target_link_libraries(${plugin_lower} gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER} gz-transport${GZ_TRANSPORT_VER}::core gz-plugin${GZ_PLUGIN_VER}::core + gz_msgs_gen ) install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})