[cmake-developers] CMP0043 warnings everywhere

Brad King brad.king at kitware.com
Wed Apr 23 13:06:17 EDT 2014


On 04/23/2014 12:57 PM, James Bigler wrote:
> I'm getting tons of CMP0043 warnings on my existing project.
> 
> I have cmake_policy(VERSION 2.6) set in my project.
> Why am I being pestered by warnings?  Shouldn't I get a policy
> value appropriate for 2.6 (so CMP0043 should be set to OLD)?

Setting policies by VERSION leaves policies newer than that
version unset, not set to OLD.  If it were to set them to OLD
then no new policies would ever warn.  There is intentionally
no way to turn off warnings about policies newer than those
known to the project code, except by using -Wno-dev locally.
Otherwise developers would never see the warnings and know
to update their code.

> CMake Warning (dev) in src/CMakeLists.txt:
> Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties.
> Run "cmake --help-policy CMP0043" for policy details. Use the cmake_policy
> command to set the policy and suppress this warning.
> This warning is for project developers. Use -Wno-dev to suppress it.

The non-config COMPILE_DEFINITIONS property has supported generator
expressions since CMake 2.8.10.  They can be used to get per-config
values without using the per-config properties.

-Brad




More information about the cmake-developers mailing list