diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-20 14:04:13 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-07-02 16:40:03 +0200 |
commit | 1925cffa083bcbe3c54b8a0f2c63dc96f5168db0 (patch) | |
tree | 98415042edafb89d47f002719ed0fed0dad9c679 /Source/cmTargetPropCommandBase.cxx | |
parent | 286f22770907fad3453eadf34e641ad736237292 (diff) | |
download | cmake-1925cffa083bcbe3c54b8a0f2c63dc96f5168db0.tar.gz |
Add a SYSTEM parameter to target_include_directories (#14180)
This is similar to the include_directories(SYSTEM) signature
in that it allows telling the compiler to ignore warnings from
such headers.
Diffstat (limited to 'Source/cmTargetPropCommandBase.cxx')
-rw-r--r-- | Source/cmTargetPropCommandBase.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx index 64f40d6b32..287ce46a26 100644 --- a/Source/cmTargetPropCommandBase.cxx +++ b/Source/cmTargetPropCommandBase.cxx @@ -48,8 +48,20 @@ bool cmTargetPropCommandBase return false; } + bool system = false; unsigned int argIndex = 1; + if ((flags & PROCESS_SYSTEM) && args[argIndex] == "SYSTEM") + { + if (args.size() < 4) + { + this->SetError("called with incorrect number of arguments"); + return false; + } + system = true; + ++argIndex; + } + bool prepend = false; if ((flags & PROCESS_BEFORE) && args[argIndex] == "BEFORE") { @@ -66,7 +78,7 @@ bool cmTargetPropCommandBase while (argIndex < args.size()) { - if (!this->ProcessContentArgs(args, argIndex, prepend)) + if (!this->ProcessContentArgs(args, argIndex, prepend, system)) { return false; } @@ -77,7 +89,7 @@ bool cmTargetPropCommandBase //---------------------------------------------------------------------------- bool cmTargetPropCommandBase ::ProcessContentArgs(std::vector<std::string> const& args, - unsigned int &argIndex, bool prepend) + unsigned int &argIndex, bool prepend, bool system) { const std::string scope = args[argIndex]; @@ -105,12 +117,12 @@ bool cmTargetPropCommandBase || args[i] == "PRIVATE" || args[i] == "INTERFACE" ) { - this->PopulateTargetProperies(scope, content, prepend); + this->PopulateTargetProperies(scope, content, prepend, system); return true; } content.push_back(args[i]); } - this->PopulateTargetProperies(scope, content, prepend); + this->PopulateTargetProperies(scope, content, prepend, system); return true; } @@ -118,22 +130,22 @@ bool cmTargetPropCommandBase void cmTargetPropCommandBase ::PopulateTargetProperies(const std::string &scope, const std::vector<std::string> &content, - bool prepend) + bool prepend, bool system) { if (scope == "PRIVATE" || scope == "PUBLIC") { - this->HandleDirectContent(this->Target, content, prepend); + this->HandleDirectContent(this->Target, content, prepend, system); } if (scope == "INTERFACE" || scope == "PUBLIC") { - this->HandleInterfaceContent(this->Target, content, prepend); + this->HandleInterfaceContent(this->Target, content, prepend, system); } } //---------------------------------------------------------------------------- void cmTargetPropCommandBase::HandleInterfaceContent(cmTarget *tgt, const std::vector<std::string> &content, - bool prepend) + bool prepend, bool) { if (prepend) { |