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

Remove policy push/pop from "PCLConfig.cmake" file #3431

Merged
merged 2 commits into from
Oct 30, 2019

Conversation

SergioRAgostinho
Copy link
Member

These are not required because cmake automatically creates a new stack entry when find_package() is invoked.

Closes #2726, fixes #3062.

These are not required because cmake automatically creates
a new stack entry when find_package() is invoked.
@taketwo
Copy link
Member

taketwo commented Oct 29, 2019

According to your initial comment in the issue (#2726 (comment)):

From what I can tell, if we simply remove the push/pop policy our PCLConfig.cmake will start producing warnings in consumer projects.

This PR does remove push/pop and also sets cmake_policy(VERSION 3.5). Do I understand right that the latter is the key to avoid warnings?

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Oct 29, 2019

This PR does remove push/pop and also sets cmake_policy(VERSION 3.5). Do I understand right that the latter is the key to avoid warnings?

Yes and no. Warnings are avoided, when policies are explicitly set. cmake_policy(VERSION 3.5) does exactly this without us having to manually set each policy individually. Since we are already supporting CMP0074 which appeared after CMake 3.5, this one needs to be set explicitly.

We started using push/pop because we thought that without it, our config file would be setting project wide policies for our consumers project. However, I later discovered that calls to find_package() create a new entry policy stack. This means that whatever policies are set inside find package/config scripts are restricted to that context and do not propagate to the rest of the project. It also meant that explicit calls to push/pop are not required.

Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation!

@kunaltyagi kunaltyagi merged commit 60ff4af into PointCloudLibrary:master Oct 30, 2019
@SergioRAgostinho SergioRAgostinho deleted the cmake-push-pop branch November 8, 2019 07:53
@taketwo taketwo changed the title Remove policy push/pop from PCLConfig.cmake file. Remove policy push/pop from PCLConfig.cmake file Jan 14, 2020
@taketwo taketwo changed the title Remove policy push/pop from PCLConfig.cmake file Remove policy push/pop from "PCLConfig.cmake" file Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VISP 3.2.0 fails to build with cmake 3.14.3 and PCL 1.9.1 Remove push/pop in PCLConfig
3 participants