Repository navigation
install utilities: added cth_pkg_add_find_modules - #8
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Dependencies that install no CMake package (for example gtl, headers only) need a
Find<Package>.cmake. Until now a package built with cth_cmake could find such a module during its own build, but the generated Config.cmake could not:find_dependency(<Package> MODULE)failed for every consumer of the installed package unless the consumer provided the module itself.cth_pkg_add_find_modules(<files>...):CMAKE_MODULE_PATHof the calling directory, so a followingcth_pkg_target_find_package(<target> <Package> MODULE ...)finds them in the buildcth_create_package()installs them next to the generated Config.cmakeCMAKE_MODULE_PATHbefore thefind_dependencyblocks (a consumer's own module wins) and restores the consumer's module path at its endTested locally with a producer that packages a target depending on a header only
dummylibrary throughFinddummy.cmake, and a consumer of the installed package: the consumer finds the dependency, builds and runs, and itsCMAKE_MODULE_PATHis unchanged afterfind_package. Without the installed module the consumer fails with "dependency missing: find_package(dummy MODULE REQUIRED) failed". The CI examples do not install or consume packages, so this is not covered there.Needed for gtl as a dependency of cth.