diff options
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); } |