-
Notifications
You must be signed in to change notification settings - Fork 23
Make find_package work for rmqcpp #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,17 @@ endif() | |
|
||
target_compile_definitions(rmq PRIVATE USES_LIBRMQ_EXPERIMENTAL_FEATURES) | ||
|
||
target_include_directories(rmq PUBLIC rmqt rmqp rmqa) | ||
target_include_directories(rmq PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rmqt>) | ||
target_include_directories(rmq PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rmqp>) | ||
target_include_directories(rmq PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/rmqa>) | ||
|
||
|
||
file(GLOB RMQ_PUBLIC_HEADERS rmqa/*h rmqp/*h rmqt/*h) | ||
set_target_properties(rmq PROPERTIES PUBLIC_HEADER "${RMQ_PUBLIC_HEADERS}") | ||
|
||
install( | ||
TARGETS rmq | ||
EXPORT rmqcppTargets | ||
ARCHIVE | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT librmq-dev | ||
|
@@ -38,6 +42,17 @@ install( | |
COMPONENT librmq-dev | ||
) | ||
|
||
install(EXPORT rmqcppTargets | ||
FILE rmqcppTargets.cmake | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/rmqcpp | ||
NAMESPACE rmqcpp::) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We decided to go with |
||
|
||
include(CMakePackageConfigHelpers) | ||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This uses |
||
"${CMAKE_CURRENT_BINARY_DIR}/rmqcppConfig.cmake" | ||
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/rmqcpp) | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/rmqcppConfig.cmake" DESTINATION ${CMAKE_INSTALL_PREFIX}/share/rmqcpp) | ||
|
||
# Emit some metadata required internally | ||
set(RMQ_PC_DEP_NAMES bsl bdl bal openssl) | ||
find_package(GenBDEMetadata QUIET) | ||
|
@@ -47,4 +62,4 @@ endif() | |
find_package(EmitPkgConfigFile QUIET) | ||
if (EmitPkgConfigFile_FOUND) | ||
emit_pkgconfig_file(PKG rmq INSTALL_COMPONENT librmq-dev DEPS "${RMQ_PC_DEP_NAMES}") | ||
endif() | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@PACKAGE_INIT@ | ||
|
||
if(NOT TARGET rmqcpp) | ||
foreach(dep bal;OpenSSL;ZLIB) | ||
find_package(${dep}) | ||
endforeach() | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are needed so that the consuming upstream application does not need to explicitly do |
||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/rmqcppTargets.cmake") | ||
|
||
check_required_components(rmqcpp) |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These generator expressions are required if we are creating a relocatable package (with no absolute paths) which uses
install(TARGETS)
andinstall(EXPORT)
later to produce thermqcppTargets.cmake
file.