summaryrefslogtreecommitdiffstats
path: root/Source
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
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')
-rw-r--r--Source/CMakeLists.txt4
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx1
-rw-r--r--Source/cmLocalGenerator.cxx19
3 files changed, 21 insertions, 3 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 52cf699..0318d05 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -564,7 +564,9 @@ IF(BUILD_TESTING)
--build-generator ${CMAKE_TEST_GENERATOR}
--build-project complex
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
+ --build-options
+ -DCMAKE_TEST_DIFFERENT_GENERATOR:BOOL=${CMAKE_TEST_DIFFERENT_GENERATOR}
--test-command complex)
# ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND}
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index a7c3770..434d217 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -29,6 +29,7 @@ void cmGlobalWatcomWMakeGenerator::EnableLanguage(std::vector<std::string>const&
{
// pick a default
mf->AddDefinition("WATCOM", "1");
+ mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
mf->AddDefinition("CMAKE_WINDOWS_OBJECT_PATH", "1");
mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
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