diff --git a/cmake/Modules/Findwebots.cmake b/cmake/Modules/Findwebots.cmake index 48f3146d3..e1ac5ed39 100644 --- a/cmake/Modules/Findwebots.cmake +++ b/cmake/Modules/Findwebots.cmake @@ -42,14 +42,34 @@ if(NOT webots_FOUND) mark_as_advanced(webots_${lib}_LIBRARY) endforeach(lib ${webots_libraries}) - # Link all of our imported targets to our imported library + # Find the webots robotis libraries + set(robotis_libraries "robotis-op2;managers") + foreach(lib ${robotis_libraries}) + find_library( + "webots_robotis_${lib}_LIBRARY" + NAMES ${lib} + PATHS ${WEBOTS_HOME}/projects/robots/robotis/darwin-op/libraries + PATH_SUFFIXES robotis-op2 managers + DOC "The Webots Robotis (${lib}) library" + ) + + # Setup an imported target for this library + add_library(webots::robotis::${lib} UNKNOWN IMPORTED) + set_target_properties(webots::robotis::${lib} PROPERTIES IMPORTED_LOCATION ${webots_robotis_${lib}_LIBRARY}) + + # Setup and export our variables + set(required_vars ${required_vars} "webots_robotis_${lib}_LIBRARY") + list(APPEND webots_LIBRARIES webots::robotis::${lib}) + mark_as_advanced(webots_robotis_${lib}_LIBRARY) + endforeach(lib ${webots_libraries}) + add_library(webots::webots INTERFACE IMPORTED) target_link_libraries(webots::webots INTERFACE ${webots_LIBRARIES}) # Make sure the libraries exist in the parent scope set(webots_LIBRARIES ${webots_LIBRARIES}) - # Find our include path + # Find our webots include path find_path( "webots_INCLUDE_DIR" NAMES "webots/Robot.hpp" diff --git a/shared/message/CMakeLists.txt b/shared/message/CMakeLists.txt index 6e8ffc9a3..ebfe16a4b 100644 --- a/shared/message/CMakeLists.txt +++ b/shared/message/CMakeLists.txt @@ -28,6 +28,7 @@ add_library( messages_protobuf OBJECT "${PROJECT_BINARY_DIR}/shared/message/messages.pb.cc" "${PROJECT_BINARY_DIR}/shared/message/messages.pb.h" ) +target_link_libraries(messages_protobuf PRIVATE protobuf::libprotobuf) # Turn off clang-tidy for them set_target_properties(messages_protobuf PROPERTIES CXX_CLANG_TIDY "")