Skip to content
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

CMake Policy CMP0072 (GLNVD) not applied correctly #1095

Closed
StefanBruens opened this issue Sep 24, 2021 · 2 comments · Fixed by #1096
Closed

CMake Policy CMP0072 (GLNVD) not applied correctly #1095

StefanBruens opened this issue Sep 24, 2021 · 2 comments · Fixed by #1096

Comments

@StefanBruens
Copy link
Contributor

Commit 7d47760 moved
the cmake_policy(SET CMP0072 NEW) from the toplevel scope to the scope of the included file.

https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html:

The setting of a policy is confined in some cases to not propagate to the parent scope. For example, if the files read by the include() command or the find_package() command contain a use of cmake_policy(), that policy setting will not affect the caller by default. Both commands accept an optional NO_POLICY_SCOPE keyword to control this behavior.

StefanBruens added a commit to StefanBruens/meshlab that referenced this issue Sep 24, 2021
Commit 7d47760 ("moving some settings to an apposite cmake file")
moved the `cmake_policy(SET CMP0072 NEW)` from the toplevel scope to the
scope of the included file. For details, see
https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html

Set NO_POLICY_SCOPE when including the file, to move the POLICIES back
to the toplevel scope.

Fixes cnr-isti-vclab#1095.
StefanBruens added a commit to StefanBruens/meshlab that referenced this issue Sep 24, 2021
Commit 7d47760 ("moving some settings to an apposite cmake file")
moved the `cmake_policy(SET CMP0072 NEW)` from the toplevel scope to the
scope of the included file. For details, see
https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html

Set NO_POLICY_SCOPE when including the file, to move the POLICIES back
to the toplevel scope. Also remove the extra cmake_minimum_version from
external/CMakeLists.txt, as it implicitly calls
`cmake_policy(VERSION 3.10)`, resetting any policies introduced with
cmake 3.11 and newer (i.e. CMP0072 and CMP0077).

Fixes cnr-isti-vclab#1095.
StefanBruens added a commit to StefanBruens/meshlab that referenced this issue Sep 26, 2021
Commit 7d47760 ("moving some settings to an apposite cmake file")
moved the `cmake_policy(SET CMP0072 NEW)` from the toplevel scope to the
scope of the included file. For details, see
https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html

Set NO_POLICY_SCOPE when including the file, to move the POLICIES back
to the toplevel scope. Also remove the extra cmake_minimum_version from
external/CMakeLists.txt, as it implicitly calls
`cmake_policy(VERSION 3.10)`, resetting any policies introduced with
cmake 3.11 and newer (i.e. CMP0072).

Fixes cnr-isti-vclab#1095.
@alemuntoni
Copy link
Member

Thank you very much @StefanBruens, I didn't know that scope changed also when using include in cmake. I thought only concert the add_subdirectory instruction. Thanks!!

@alemuntoni
Copy link
Member

I think that this is also why I was having the problem related to this issue: probonopd/linuxdeployqt#486
I tried to force using legacy opengl everywhere in meshlab in order to remove libopengl.so dependency, which cannot be bundled in appimages.

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 a pull request may close this issue.

2 participants