diff options
author | Orkun Tokdemir <ilhanorkuntokdemir@gmail.com> | 2023-04-27 09:28:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-03 13:03:46 (GMT) |
commit | 7bf4e3009000b0ab576f364abc779e9a1599af08 (patch) | |
tree | bcdca570fc94f317746a03adf9b54237df1ce9fd /Source | |
parent | 033dc7ee2f02b0ebdfd1bc4edbcb24d1fc8c4152 (diff) | |
download | CMake-7bf4e3009000b0ab576f364abc779e9a1599af08.zip CMake-7bf4e3009000b0ab576f364abc779e9a1599af08.tar.gz CMake-7bf4e3009000b0ab576f364abc779e9a1599af08.tar.bz2 |
Autogen: Default AUTOGEN_USE_SYSTEM_INCLUDE to ON if it is not set
Add policy CMP0151 to preserve the old behavior by default.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmPolicies.h | 4 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 23e50a9..a0030d3 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -455,6 +455,10 @@ class cmMakefile; "ExternalProject_Add and FetchContent_Declare commands " \ "treat relative GIT_REPOSITORY paths as being relative " \ "to the parent project's remote.", \ + 3, 27, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0151, \ + "AUTOMOC include directory is a system include directory by " \ + "default.", \ 3, 27, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index deb2c04..544e1ef 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -587,7 +587,18 @@ bool cmQtAutoGenInitializer::InitCustomTargets() addBefore = true; } } else { - addBefore = true; + switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0151)) { + case cmPolicies::WARN: + case cmPolicies::OLD: + addBefore = true; + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + this->GenTarget->AddSystemIncludeDirectory(this->Dir.IncludeGenExp, + "CXX"); + break; + } } this->GenTarget->AddIncludeDirectory(this->Dir.IncludeGenExp, addBefore); } |