diff options
author | Brad King <brad.king@kitware.com> | 2013-03-19 23:37:49 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-03-19 23:37:49 (GMT) |
commit | 3efede0ccc1431c0d8a997d97b03207f9b7aded4 (patch) | |
tree | 93c06f089b5e818ee0780f66e37c4c62923d54b5 /Source | |
parent | 017478570eb47241141fa06e8ca2688e4a2b1f87 (diff) | |
parent | 753b905ec86ffe369d4f59a7a8ced5fedc42939f (diff) | |
download | CMake-3efede0ccc1431c0d8a997d97b03207f9b7aded4.zip CMake-3efede0ccc1431c0d8a997d97b03207f9b7aded4.tar.gz CMake-3efede0ccc1431c0d8a997d97b03207f9b7aded4.tar.bz2 |
Merge topic 'automoc-append-implicit-dirs'
753b905 Automoc: append implicit includes after user-specified dirs
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index dc39fdc..ee5b9d8 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1407,20 +1407,22 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, return; } - if (stripImplicitInclDirs) - { - // Load implicit include directories for this language. - std::string impDirVar = "CMAKE_"; - impDirVar += lang; - impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES"; - if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str())) - { - std::vector<std::string> impDirVec; - cmSystemTools::ExpandListArgument(value, impDirVec); - for(std::vector<std::string>::const_iterator i = impDirVec.begin(); - i != impDirVec.end(); ++i) + std::vector<std::string> implicitDirs; + // Load implicit include directories for this language. + std::string impDirVar = "CMAKE_"; + impDirVar += lang; + impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES"; + if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str())) + { + std::vector<std::string> impDirVec; + cmSystemTools::ExpandListArgument(value, impDirVec); + for(std::vector<std::string>::const_iterator i = impDirVec.begin(); + i != impDirVec.end(); ++i) + { + emitted.insert(*i); + if (!stripImplicitInclDirs) { - emitted.insert(*i); + implicitDirs.push_back(*i); } } } @@ -1463,6 +1465,15 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, dirs.push_back(*i); } } + + for(std::vector<std::string>::const_iterator i = implicitDirs.begin(); + i != implicitDirs.end(); ++i) + { + if(std::find(includes.begin(), includes.end(), *i) != includes.end()) + { + dirs.push_back(*i); + } + } } void cmLocalGenerator::GetTargetFlags(std::string& linkLibs, |