Open
Conversation
The CMakeFindDependencyMacro is a 3.0 feature, while core-moos supports as low as [CMake 2.8](https://github.com/themoos/core-moos/blob/64c9750f53b0d049a4cd9ec771bc1dc397a9fb65/CMakeLists.txt\#L7). The issue isn't apparent when building core-moos alone, however, when a dependent project (say, essential-moos) tries to use it an error is produced, citing the lack of CMakeFindDependencyMacro, and therefore find_dependency. This commit uses the slightly different find_package function, which is supported on CMake 2.8 systems.
Contributor
alastair-harrison-oxb
left a comment
There was a problem hiding this comment.
This looks like a reasonable change if the switch to a newer version of CMake is not possible/desirable.
AFAIK find_dependency does the same thing as find_package but additionally respects any QUIET flag sent to the enclosing find_package call to suppress log output.
aharrison24
approved these changes
Apr 2, 2020
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.
The CMakeFindDependencyMacro is a 3.0 feature, while core-moos supports as low as CMake 2.8. The issue isn't apparent when building core-moos alone, however, when a dependent project (say, essential-moos) tries to use it an error is produced, citing the lack of CMakeFindDependencyMacro, and therefore find_dependency. This commit uses the slightly different find_package function, which is supported on CMake 2.8 systems.
To reproduce, boot a system with CMake 2.8 (I'm using CentOS 7), clone both core-moos and essential-moos, cmake && make core-moos (there shouldn't be any errors), then try to cmake essential-moos. The error should present itself.
The alternative to this patch is to explicitly set 3.0 as the minimum requirement, though this may have negative impact on downstream projects.
Testing would be appreciated from whoever can.
Thanks!