summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-12-04 15:36:48 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-02-22 11:31:49 (GMT)
commitedd5303949f9d0e1b4b11e83aecd34bfdb2700ce (patch)
treee7c4328884cba9f0c5b07fb3ed4c78d39ecbb02a /Source/cmLocalGenerator.cxx
parent6a1c5a356911d3b75e60ecad86d7538e6de888f9 (diff)
downloadCMake-edd5303949f9d0e1b4b11e83aecd34bfdb2700ce.zip
CMake-edd5303949f9d0e1b4b11e83aecd34bfdb2700ce.tar.gz
CMake-edd5303949f9d0e1b4b11e83aecd34bfdb2700ce.tar.bz2
Refactor GetIncludeFlags to take includes instead of fetching them
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffbeb48..b02fc36 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -574,7 +574,11 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
std::string flags;
flags += this->Makefile->GetSafeDefinition(varString.c_str());
flags += " ";
- flags += this->GetIncludeFlags(lang);
+ {
+ std::vector<std::string> includes;
+ this->GetIncludeDirectories(includes, lang);
+ flags += this->GetIncludeFlags(includes, lang);
+ }
flags += this->Makefile->GetDefineFlags();
// Construct the command lines.
@@ -1192,8 +1196,9 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
}
//----------------------------------------------------------------------------
-const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
- bool forResponseFile)
+const char* cmLocalGenerator::GetIncludeFlags(
+ const std::vector<std::string> &includes,
+ const char* lang, bool forResponseFile)
{
if(!lang)
{
@@ -1207,9 +1212,6 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
}
cmOStringStream includeFlags;
- std::vector<std::string> includes;
- this->GetIncludeDirectories(includes, lang);
- std::vector<std::string>::iterator i;
std::string flagVar = "CMAKE_INCLUDE_FLAG_";
flagVar += lang;
@@ -1251,6 +1253,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
#ifdef __APPLE__
emitted.insert("/System/Library/Frameworks");
#endif
+ std::vector<std::string>::const_iterator i;
for(i = includes.begin(); i != includes.end(); ++i)
{
if(this->Makefile->IsOn("APPLE")