-
Notifications
You must be signed in to change notification settings - Fork 219
Add CMake configuration file and export installed targets #204
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d20cab6
Add CMake configuration file and export installed targets
40e8559
Remove warning for cmake policy CMP0074
c4b6a95
Fixes per code review
11a6e42
Remove comment from config file relating to not finding the RdKafka c…
0d2356f
Changed link libraries to PUBLIC so they get exported in the CppKafka…
ee30fab
Added INTERFACE_LINK_DIRECTORIES to the RdKafka::rdkafka properties
591e8ab
Changed include_directories to taget_include_directories and removed …
bbc78f8
Fixed conflicts
097184c
Added COMPONENT tags to the install targets. Also when installing TAR…
4bddb22
Added INSTALL_RPATH and INSTALL_RPATH_USE_LINK_PATH to CppKafka targe…
ad800a5
Added RdKafka hex version so that FindRdKafka.cmake can compile the t…
20b8060
Added options to conditionally disable installation of configuration …
dd6ec44
Updated pkg_config file name
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| @PACKAGE_INIT@ | ||
|
|
||
| include(CMakeFindDependencyMacro) | ||
|
|
||
| # Add FindRdKafka.cmake | ||
| set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}") | ||
|
|
||
| set(RDKAFKA_MIN_VERSION_HEX "@RDKAFKA_MIN_VERSION_HEX@") | ||
|
|
||
| # Find boost optional | ||
| find_dependency(Boost REQUIRED) | ||
|
|
||
| # Try to find the RdKafka configuration file if present. | ||
| # This will search default system locations as well as RdKafka_ROOT and RdKafka_DIR paths if specified. | ||
| find_package(RdKafka QUIET CONFIG) | ||
| set(RDKAFKA_TARGET_IMPORTS ${RdKafka_FOUND}) | ||
| if (NOT RdKafka_FOUND) | ||
| find_dependency(RdKafka REQUIRED MODULE) | ||
| endif() | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/@TARGET_EXPORT_NAME@.cmake") | ||
|
|
||
| # Export 'CppKafka_ROOT' | ||
| set_and_check(@PROJECT_NAME@_ROOT "@PACKAGE_CMAKE_INSTALL_PREFIX@") | ||
|
|
||
| # Export 'CppKafka_INSTALL_INCLUDE_DIR' | ||
| set_and_check(@PROJECT_NAME@_INSTALL_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") | ||
|
|
||
| # Export 'CppKafka_INSTALL_LIB_DIR' | ||
| set_and_check(@PROJECT_NAME@_INSTALL_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") | ||
|
|
||
| # Validate installed components | ||
| check_required_components("@PROJECT_NAME@") |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this needed? I think I've used
-Dsomething=../../xand it works IIRC.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.
It didn't for me. Seems that find_package() expects a proper relative path from the point where it's being evaluated. In this case it was evaluated from
cppkafka/cmakewhich made Travis fail. The second thing is that when using the CppkafkaConfig.cmake, which in turn calls FindRdKafka.cmake , you have no control of where it will be accessed from. This is meant to be used by 3rd party libs linking CppKafka. So FindRdKafka.cmake should have a proper path to the RdKafka root.