[cmake-developers] Automatically set policies for shipped modules

Craig Scott craig.scott at crascit.com
Mon Sep 17 09:14:52 EDT 2018


On Mon, Sep 17, 2018 at 9:07 PM Brad King <brad.king at kitware.com> wrote:

> On 09/17/2018 04:01 AM, Rolf Eike Beer wrote:
> > I suggest that every module included from the CMake installation is
> > considered clean for whatever we do and automatically gets a policy
> > scope push/pop right from the C++ level.
>
> That's fine with me for policies like CMP0057 that affect the
> CMake language features.  We can't do that for every policy
> because some policies affect the way modules behave for the
> calling project.
>
> When include() or find_package() establishes the policy scope
> for the included module we can inject a few settings.
>

We may also need to be careful about CMP0011 (Included scripts do automatic
cmake_policy PUSH and POP), since that has come up before with regard to
why some modules needed explicit policy push-pop even though include()
would normally do that for us automatically.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide
<https://crascit.com/professional-cmake/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180917/abeadefd/attachment.html>


More information about the cmake-developers mailing list