Skip to content

fix superbuild cmake < 3.17 #193

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

Conversation

xmuller
Copy link
Contributor

@xmuller xmuller commented Feb 6, 2021

issue: #192

  • CPM_INDENT (first commit) :
    I agree with you. set(CPM_INDENT "CPM:" CACHE INTERNAL "") seems to be appropriate.

  • include(FetchContent):
    Since the problem only occurs when using cmake < 3.17, I suggest to check the current cmake version and call include(FetchContent) for each include(CPM.cmake) when necessary.

During a future upgrade of the minimal cmake version, this can be noticed and removed easily.

@TheLartians
Copy link
Member

Hey thanks for the PR! Yeah, the version fallback seems like a good approach. I wonder if we should also include(CMakeParseArguments), as it's used by CPM.cmake functions as well.

@xmuller
Copy link
Contributor Author

xmuller commented Feb 6, 2021

For include(CMakeParseArguments) I didn't notice any problem. Since CMakeParseArguments only serves to manipulate variables I don't see how there would be an internal bug in cmake with this use case.

If I notice anything strange while continuing my project I will bring up the problem anyway.

Copy link
Member

@TheLartians TheLartians left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I understood that the CMake include behaviour was causing the error, but if it's indeed due to an internal bug this approach makes perfect sense!

@TheLartians TheLartians merged commit 1f5cb90 into cpm-cmake:master Feb 7, 2021
@TheLartians
Copy link
Member

Fix is live in v0.28.3! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FetchContent failure when using CPM on multiple projects with cmake < 3.17
2 participants