diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-07-02 12:30:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-16 17:44:57 (GMT) |
commit | 9cf3547e1cd56d42bc96c3dc3adf9f745faea5ee (patch) | |
tree | ea220c1949611ac1977841ea77ff22bcac061497 /Source/cmGeneratorTarget.cxx | |
parent | 1925cffa083bcbe3c54b8a0f2c63dc96f5168db0 (diff) | |
download | CMake-9cf3547e1cd56d42bc96c3dc3adf9f745faea5ee.zip CMake-9cf3547e1cd56d42bc96c3dc3adf9f745faea5ee.tar.gz CMake-9cf3547e1cd56d42bc96c3dc3adf9f745faea5ee.tar.bz2 |
Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.
Unlike other target properties, this does not have a corresponding
non-INTERFACE variant.
This allows propagation of system attribute on include directories
from link dependents.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9167b25..5ce0e6b 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -51,21 +51,43 @@ const char *cmGeneratorTarget::GetProperty(const char *prop) bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, const char *config) { - for (std::set<cmStdString>::const_iterator - it = this->Target->GetSystemIncludeDirectories().begin(); - it != this->Target->GetSystemIncludeDirectories().end(); ++it) + std::string config_upper; + if(config && *config) { - cmListFileBacktrace lfbt; - cmGeneratorExpression ge(lfbt); + config_upper = cmSystemTools::UpperCase(config); + } + + typedef std::map<std::string, std::vector<std::string> > IncludeCacheType; + IncludeCacheType::iterator iter = + this->SystemIncludesCache.find(config_upper); - std::vector<std::string> incs; - cmSystemTools::ExpandListArgument(ge.Parse(*it) - ->Evaluate(this->Makefile, - config, false), incs); - if (std::find(incs.begin(), incs.end(), dir) != incs.end()) + if (iter == this->SystemIncludesCache.end()) + { + std::vector<std::string> result; + for (std::set<cmStdString>::const_iterator + it = this->Target->GetSystemIncludeDirectories().begin(); + it != this->Target->GetSystemIncludeDirectories().end(); ++it) { - return true; + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + + cmGeneratorExpressionDAGChecker dagChecker(lfbt, + this->GetName(), + "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", 0, 0); + + cmSystemTools::ExpandListArgument(ge.Parse(*it) + ->Evaluate(this->Makefile, + config, false, this->Target, + &dagChecker), result); } + IncludeCacheType::value_type entry(config_upper, result); + iter = this->SystemIncludesCache.insert(entry).first; + } + + if (std::find(iter->second.begin(), + iter->second.end(), dir) != iter->second.end()) + { + return true; } return false; } |