[CMake] Setting Policy CMP0028

Nils Gladitz nilsgladitz at gmail.com
Fri Jul 11 05:31:14 EDT 2014


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


More information about the CMake mailing list