CMP0151 — CMake 3.27.7 Documentation

# CMP0151

New in version 3.27.

AUTOMOC include directory is a system include directory by default.

Headers generated for AUTOMOC are placed in target-specific include directories. CMake 3.26 and older added these as normal include directories. CMake 3.27 and newer prefer to add them as system include directories. This policy provides compatibility for projects that have not been updated to expect this.

If the `AUTOGEN_USE_SYSTEM_INCLUDE` target property is set, perhaps via the `CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE` variable, then its value is used regardless of the setting of this policy.

The `OLD` behavior for this policy is to add autogen include directory to the target's include directories. The `NEW` behavior for this policy is to add autogen include directory to the target's system include directories.

This policy was introduced in CMake version 3.27. Use the `cmake_policy()` command to set it to `OLD` or `NEW` explicitly. Unlike many policies, CMake version 3.27.7 does not warn when this policy is not set and simply uses `OLD` behavior.

Note

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