W3cubDocs

/CMake 3.19

CMP0071

New in version 3.10.

Let AUTOMOC and AUTOUIC process GENERATED files.

Since version 3.10, CMake processes regular and GENERATED source files in AUTOMOC and AUTOUIC. In earlier CMake versions, only regular source files were processed. GENERATED source files were ignored silently.

This policy affects how source files that are GENERATED get treated in AUTOMOC and AUTOUIC.

The OLD behavior for this policy is to ignore GENERATED source files in AUTOMOC and AUTOUIC.

The NEW behavior for this policy is to process GENERATED source files in AUTOMOC and AUTOUIC just like regular source files.

Note

To silence the CMP0071 warning source files can be excluded from AUTOMOC and AUTOUIC processing by setting the source file properties SKIP_AUTOMOC, SKIP_AUTOUIC or SKIP_AUTOGEN.

Source skip example:

# ...
set_property(SOURCE /path/to/file1.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE /path/to/file2.h PROPERTY SKIP_AUTOUIC ON)
set_property(SOURCE /path/to/file3.h PROPERTY SKIP_AUTOGEN ON)
# ...

This policy was introduced in CMake version 3.10. CMake version 3.19.0-rc3 warns when the policy is not set and uses OLD behavior. Use the cmake_policy() command to set it to OLD or NEW explicitly.

Note

The OLD behavior of a policy is deprecated by definition and may be removed in a future version of CMake.

© 2000–2020 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.19/policy/CMP0071.html