[CMake] Setting Policy CMP0028

pierre.andersson at se.atlascopco.com pierre.andersson at se.atlascopco.com
Fri Jul 11 07:33:29 EDT 2014


Thanks for the response. None of those are called in the CMakeLists.txt
file that the warning is issued for, they are both called in a file above
that one  in the build tree but said file also sets the CML0028 policy
afterwards. Is it possible that a call to cmake_minimum_required resets the
policies even for CMakeLists.txt that are not below it in the build system
tree?

Regards,
Pierre Andersson




From:	Nils Gladitz <nilsgladitz at gmail.com>
To:	pierre.andersson at se.atlascopco.com, cmake at cmake.org
Date:	2014-07-11 11:31
Subject:	Re: [CMake] Setting Policy CMP0028



On 07/11/2014 11:00 AM, pierre.andersson at se.atlascopco.com wrote:
> I have a very large project that is built with CMake, and I'm trying to
> make it work a little nicer with CMake 3. Right now we, we see everal
> warnigns that policy CMP0028 is not set.
>
> Using
>
> cmake_policy(SET CMP0028 OLD)
>
> does not seem to take effect. It's set at the same, top level, place
> where other policies are set and these do take effect. Likewise, setting
> the policy to NEW does not make CMake produce the fatal error like the
> documentation says it should. What am I missing here?

With a minimal test case the policy seems to work for me in 3.0.

What might reset the policy after it was set is:
		 - A call to cmake_minimum_required()
		 - A call to cmake_policy(VERSION)

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140711/3adc07e6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140711/3adc07e6/attachment.gif>


More information about the CMake mailing list