Skip to content

Autogen: Update CMP0071 warning and documentation

  • Update AUTOGEN CMP0071 description
  • Offer solution in AUTOGEN CMP0071 warning message
  • Extend SKIP_AUTO* documentation

Example warning message

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  AUTOMOC: Ignoring the GENERATED source file(s):

    "/some/path/main.cpp"

  Setting `cmake_minimum_required(VERSION 3.10)` or `cmake_policy(SET CMP0071
  NEW)` lets AUTOMOC process the GENERATED files as well and silences this
  warning.

  Alternatively the file(s) can be explicitly excluded from AUTOMOC
  processing by setting the source file property SKIP_AUTOMOC:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON)
    set_source_files_properties(file1.h file2.h PROPERTIES SKIP_AUTOMOC ON)

This warning is for project developers.  Use -Wno-dev to suppress it.

Merge request reports