Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 10 additions & 32 deletions external/zmqpp_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion external/zmqpp_vendor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>ament_cmake_vendor_package</buildtool_depend>
<buildtool_depend>git</buildtool_depend>

<depend>libzmq3-dev</depend>
Expand Down
25 changes: 25 additions & 0 deletions external/zmqpp_vendor/patches/zmqpp_export.patch
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions external/zmqpp_vendor/zmqpp_vendor-extras.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
list(APPEND zmqpp_vendor_TARGETS zmqpp)