From 7f237c51f413a350090e68929eee9f8380c5bcfe Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 23 Jan 2006 13:50:23 -0500 Subject: ENH: fix problem with watcom and short paths and -I --- Source/CMakeLists.txt | 4 +++- Source/cmGlobalWatcomWMakeGenerator.cxx | 1 + Source/cmLocalGenerator.cxx | 19 +++++++++++++++++-- 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::vectorconst& { // 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 -- cgit v0.12