[cmake-developers] CMake API for warnings

Brad King brad.king at kitware.com
Mon Apr 25 14:58:46 EDT 2016


On 04/23/2016 12:11 AM, Ruslan Baratov wrote:
> It means ignoring directory properties. So by default we will inherit settings.
[snip]
> To disable inheriting we need to add extra argument (?) to *_compile_warnings:
> 
>      add_compile_warnings(DISABLE warn-A)
>      target_compile_warnings(foo DISABLE warn-B IGNORE DIRECTORY)

We don't have such a feature for any of the other build settings so
there is no precedent for how to represent this or its exact semantics.

We may not need the capability at all.  For other properties like
COMPILE_OPTIONS and INCLUDE_DIRECTORIES the target-level property
is initialized from the directory-level property when the target
is created.  After that the directory-level property has no meaning
to the target.  One may then set the target-level property to
erase any content previously taken from the directory-level
property.  This allows specific targets to ignore the directory-level
property in special cases.

-Brad



More information about the cmake-developers mailing list