summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-01-23 18:50:23 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-01-23 18:50:23 (GMT)
commit7f237c51f413a350090e68929eee9f8380c5bcfe (patch)
treeab344979e827483f3dc063217c7a432f2e1e2b0e /Source/cmLocalGenerator.cxx
parent5c692ee247bb79eacc71350524d60a19dac80903 (diff)
downloadCMake-7f237c51f413a350090e68929eee9f8380c5bcfe.zip
CMake-7f237c51f413a350090e68929eee9f8380c5bcfe.tar.gz
CMake-7f237c51f413a350090e68929eee9f8380c5bcfe.tar.bz2
ENH: fix problem with watcom and short paths and -I
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1581d59..8b2bd26 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1049,7 +1049,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
flagVar = "CMAKE_INCLUDE_FLAG_SEP_";
flagVar += lang;
const char* sep = m_Makefile->GetDefinition(flagVar.c_str());
-
+ bool quotePaths = false;
+ if(m_Makefile->GetDefinition("CMAKE_QUOTE_INCLUDE_PATHS"))
+ {
+ quotePaths = true;
+ }
bool repeatFlag = true; // should the include flag be repeated like ie. -IA -IB
if(!sep)
{
@@ -1084,7 +1088,18 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
includeFlags << includeFlag;
flagUsed = true;
}
- includeFlags << this->ConvertToOutputForExisting(i->c_str()) << sep;
+ includeFlags;
+ std::string includePath = this->ConvertToOutputForExisting(i->c_str());
+ if(quotePaths && includePath.size() && includePath[0] != '\"')
+ {
+ includeFlags << "\"";
+ }
+ includeFlags << includePath;
+ if(quotePaths && includePath.size() && includePath[0] != '\"')
+ {
+ includeFlags << "\"";
+ }
+ includeFlags << sep;
}
std::string flags = includeFlags.str();
// remove trailing separators