From e15d0c6091b736ecaa7d13d32d99fcb1b1bfd0f7 Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Mon, 23 Jun 2025 18:43:44 +0900 Subject: [PATCH] Use ament_vendor (https://github.com/tier4/zmqpp_vendor/pull/9) --- external/zmqpp_vendor/CMakeLists.txt | 42 +++++-------------- external/zmqpp_vendor/package.xml | 2 +- .../zmqpp_vendor/patches/zmqpp_export.patch | 25 +++++++++++ .../zmqpp_vendor/zmqpp_vendor-extras.cmake | 1 + 4 files changed, 37 insertions(+), 33 deletions(-) create mode 100644 external/zmqpp_vendor/patches/zmqpp_export.patch create mode 100644 external/zmqpp_vendor/zmqpp_vendor-extras.cmake diff --git a/external/zmqpp_vendor/CMakeLists.txt b/external/zmqpp_vendor/CMakeLists.txt index 2a8c35ae4bd..96ee0dcf21a 100644 --- a/external/zmqpp_vendor/CMakeLists.txt +++ b/external/zmqpp_vendor/CMakeLists.txt @@ -5,38 +5,16 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() -find_package(ament_cmake_auto REQUIRED) -ament_auto_find_build_dependencies() +find_package(ament_cmake REQUIRED) +find_package(ament_cmake_vendor_package REQUIRED) -macro(build_zmqpp) - set(cmake_commands) - set(cmake_configure_args - -Wno-dev - -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install) +ament_vendor(zmqpp_vendor + SATISFIED ${zmqpp_FOUND} + VCS_URL https://github.com/zeromq/zmqpp.git + VCS_VERSION da73a138f290274cfd604b3f05a908956390a66e + PATCHES patches/zmqpp_export.patch +) - include(ExternalProject) - externalproject_add(cpp-zmqpp-ext - GIT_REPOSITORY https://github.com/zeromq/zmqpp.git - GIT_TAG master - TIMEOUT 6000 - ${cmake_commands} - CMAKE_ARGS ${cmake_configure_args} - ) - install( - DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install/ - DESTINATION - ${CMAKE_INSTALL_PREFIX} - ) -endmacro() +ament_export_dependencies(zmqpp) -build_zmqpp() -ament_export_include_directories(include) -ament_export_libraries(zmqpp) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - ament_lint_auto_find_test_dependencies() -endif() - -ament_auto_package() +ament_package(CONFIG_EXTRAS zmqpp_vendor-extras.cmake) diff --git a/external/zmqpp_vendor/package.xml b/external/zmqpp_vendor/package.xml index 570d44fddd7..889f592c28b 100644 --- a/external/zmqpp_vendor/package.xml +++ b/external/zmqpp_vendor/package.xml @@ -8,7 +8,7 @@ Apache License 2.0 ament_cmake - ament_cmake_auto + ament_cmake_vendor_package git libzmq3-dev diff --git a/external/zmqpp_vendor/patches/zmqpp_export.patch b/external/zmqpp_vendor/patches/zmqpp_export.patch new file mode 100644 index 00000000000..c3a24cc16a6 --- /dev/null +++ b/external/zmqpp_vendor/patches/zmqpp_export.patch @@ -0,0 +1,25 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 489916a..19ab1ac 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -230,9 +230,11 @@ endif() + # Install + # ------- + install(TARGETS ${INSTALL_TARGET_LIST} ++ EXPORT zmqpp-targets + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib) ++ ARCHIVE DESTINATION lib ++ INCLUDES DESTINATION include) + + install(DIRECTORY src/zmqpp DESTINATION include/ + FILES_MATCHING PATTERN "*.hpp") +@@ -240,3 +242,7 @@ install(DIRECTORY src/zmqpp DESTINATION include/ + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/zmqpp_export.h" + DESTINATION "include") ++ ++install(EXPORT zmqpp-targets ++ FILE zmqpp-config.cmake ++ DESTINATION lib/cmake/zmqpp) diff --git a/external/zmqpp_vendor/zmqpp_vendor-extras.cmake b/external/zmqpp_vendor/zmqpp_vendor-extras.cmake new file mode 100644 index 00000000000..2c021690385 --- /dev/null +++ b/external/zmqpp_vendor/zmqpp_vendor-extras.cmake @@ -0,0 +1 @@ +list(APPEND zmqpp_vendor_TARGETS zmqpp)