-
Notifications
You must be signed in to change notification settings - Fork 190
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
replace deprecated calls to FetchContent_Populate #570
Merged
TheLartians
merged 9 commits into
cpm-cmake:master
from
Avus-c:fix/fetchcontent_populate-deprecated
Jul 29, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
873bbec
replace deprecated calls to FetchContent_Populate
Avus-c 3e052e8
fix: OPTIONS passed to CPMAddPackage not set
Avus-c aff9803
refactor: remove an unnecessary else branch
Avus-c 82836e6
ci: include cmake 3.30 in test matrix
Avus-c bf56eda
fix: forward SOURCE_SUBDIR to FetchContent_Declare
Avus-c 77dc92f
fix: only set options if download_only is false
Avus-c 6f2cf67
fix: DOWNLOAD_ONLY test
Avus-c 0e8ca2a
refactor: always use *_Populate to reduce code paths
Avus-c b416836
Revert "refactor: always use *_Populate to reduce code paths"
Avus-c 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 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 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.
Question out of curiosity as I now realise this form of
FetchContent_Populate
isn't deprecated: could we not only change the originalFetchContent_Populate
here to the explicit syntax here and have it work on both old and new version of CMake without the version-specific changes? Or is there something I'm missing?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.
Yes, we could switch fully over to
*_Populate
.I’m not really a fan of that, since it seems like the CMake devs are pushing us towards using
*_Declare
and*_MakeAvailable
over the last few updates. Switching to*_Populate
feels like we’re going against that trend.That being said, maintaining three different code paths to achieve the same goal is probably alot worse. It complicates the review process and makes the code harder to manage.
I guess, if we run into issues with
*_Populate
in the future, we can deal with them then. :DAnyway, latest commit switches everything to
*_Populate
with the explicit syntax. This has the sideeffect thatcpm_declare_fetch
could be removed, because it's not being used by anything anymore. And compared to master the changes are minimal.The unittests passed locally, but I'm out of time and not able to test on some of my larger projects. :D