-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Set CMake policy CMP0074
to NEW
#2671
Conversation
# 1. Find*.cmake modules need to be individually verified. | ||
# 2. PCLConfig.cmake needs to be changed. | ||
cmake_policy(SET CMP0074 OLD) | ||
# 1. Remove with 3.12.4. |
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.
What do you mean by this?
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's the version in which the policy came into effect. So it means that when we set the minimum version of cmake to 3.12, this will no longer be needed.
Given your question I assume it's a good idea to rewrite that comment.
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.
But if the policy is not set CMake will default to OLD?
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.
Let me write a couple of cases to clarify:
- Case 1:
- Policy: Not Set
- CMake minimum required version: 3.1
- CMake version used: 3.1
- Results: You get the OLD behavior. CMake 3.1 doesn't even know about this policy because it was only created in version 3.12 it he behaves with the OLD behavior.
- Case 2:
- Policy: Not Set
- CMake minimum required version: 3.1
- CMake version used: 3.12
- Results: You get the OLD behavior by default and a warning saying to explicitly set the bhavior. CMake 3.12 wants you to know that things changed.
- Case 3:
- Policy: Not Set
- CMake minimum required version: 3.12
- CMake version used: 3.12
- Results: You get the new behavior by default.
- Case 4:
- Policy: Explicitly set to NEW
- CMake minimum required version: 3.1
- CMake version used: 3.1
- Results: CMake 3.1 doesn't even know about this policy and ignores it. It still behaves in the OLD behavior.
- Case 5:
- Policy: Explicitly set to NEW
- CMake minimum required version: 3.1
- CMake version used: 3.12
- Results: You get the NEW behavior. You're in a situation in which you're compliant with CMake versions from the minimum required one all the way to 3.12+
- Case 6:
- Policy: Explicitly set to NEW
- CMake minimum required version: 3.12
- CMake version used: 3.12
- Results: You get the new behavior by default but now you're explicitly setting it although it isn't required.
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.
Thanks for the detailed list, I wasn't aware that case 3 behaves this way. Although it's the most logical thing to do. And from CMake docs:
The cmake_minimum_required() command does more than report an error if a too-old version of CMake is used to build a project. It also sets all policies introduced in that CMake version or earlier to NEW behavior.
One related detail on this PR: I don't seem to have permissions to rerun jobs on the CI (without committing any new code). Are you able to do it? |
Stray failure on one unit test in ubuntu. It's good to be merged. |
CMP0074
to NEW
I reviewed things and I believe we're compliant. We only use
*_ROOT
variables to specify prefixes so it's totally ok, if CMake uses them to try and locate libraries by default.Closes #2446