Procházet zdrojové kódy

ENH: fix problem with watcom and short paths and -I

Bill Hoffman před 20 roky
rodič
revize
7f237c51f4

+ 3 - 1
Source/CMakeLists.txt

@@ -564,7 +564,9 @@ IF(BUILD_TESTING)
       --build-generator ${CMAKE_TEST_GENERATOR}
       --build-generator ${CMAKE_TEST_GENERATOR}
       --build-project complex
       --build-project complex
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --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)
       --test-command complex)
 
 
 #    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}
 #    ADD_TEST(complexRelativePaths  ${CMAKE_CTEST_COMMAND}

+ 1 - 0
Source/cmGlobalWatcomWMakeGenerator.cxx

@@ -29,6 +29,7 @@ void cmGlobalWatcomWMakeGenerator::EnableLanguage(std::vector<std::string>const&
 {
 {
   // pick a default 
   // pick a default 
   mf->AddDefinition("WATCOM", "1");
   mf->AddDefinition("WATCOM", "1");
+  mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
   mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
   mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
   mf->AddDefinition("CMAKE_WINDOWS_OBJECT_PATH", "1");
   mf->AddDefinition("CMAKE_WINDOWS_OBJECT_PATH", "1");
   mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
   mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");

+ 17 - 2
Source/cmLocalGenerator.cxx

@@ -1049,7 +1049,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
   flagVar = "CMAKE_INCLUDE_FLAG_SEP_";
   flagVar = "CMAKE_INCLUDE_FLAG_SEP_";
   flagVar += lang;
   flagVar += lang;
   const char* sep = m_Makefile->GetDefinition(flagVar.c_str());
   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
   bool repeatFlag = true; // should the include flag be repeated like ie. -IA -IB
   if(!sep)
   if(!sep)
     {
     {
@@ -1084,7 +1088,18 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
       includeFlags << includeFlag;
       includeFlags << includeFlag;
       flagUsed = true;
       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();
   std::string flags = includeFlags.str();
   // remove trailing separators
   // remove trailing separators