This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  803a7cb19950ea307568294e324ad73646026cfa (commit)
       via  662756036e4f4983b00ab7740773a55bef808c64 (commit)
      from  d6e83d242d46edf89e83c1d4081defe7cc923bb4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=803a7cb19950ea307568294e324ad73646026cfa
commit 803a7cb19950ea307568294e324ad73646026cfa
Merge: d6e83d2 6627560
Author:     David Cole <david.c...@kitware.com>
AuthorDate: Tue Jan 25 19:07:07 2011 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Tue Jan 25 19:07:07 2011 -0500

    Merge topic 'fix-11695-spaces-in-vs10-rc-defs' into next
    
    6627560 VS10: Escape double quote chars in defines for rc files (#11695)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=662756036e4f4983b00ab7740773a55bef808c64
commit 662756036e4f4983b00ab7740773a55bef808c64
Author:     David Cole <david.c...@kitware.com>
AuthorDate: Tue Jan 25 18:54:36 2011 -0500
Commit:     David Cole <david.c...@kitware.com>
CommitDate: Tue Jan 25 19:01:13 2011 -0500

    VS10: Escape double quote chars in defines for rc files (#11695)
    
    To get rc defines to work in the VS10 IDE requires \" when
    constructing PreprocessorDefinitions strings. This is different
    than defines for cl.
    
    Also, per-file rc defines were not being generated. Fix that, too.

diff --git a/Source/cmLocalVisualStudio7Generator.cxx 
b/Source/cmLocalVisualStudio7Generator.cxx
index 21f6460..7d36153 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -755,7 +755,7 @@ void 
cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     }
   fout << "\"\n";
   targetOptions.OutputFlagMap(fout, "\t\t\t\t");
-  targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
+  targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
   fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
   fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
   if(targetBuilds)
@@ -789,7 +789,7 @@ void 
cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     }
   // add the -D flags to the RC tool
   fout << "\"";
-  targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "");
+  targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "", "RC");
   fout << "/>\n";
   tool = "VCMIDLTool";
   if(this->FortranProject)
@@ -1462,6 +1462,7 @@ void cmLocalVisualStudio7Generator
       else if(!fcinfo.FileConfigMap.empty())
         {
         const char* aCompilerTool = "VCCLCompilerTool";
+        const char* lang = "CXX";
         if(this->FortranProject)
           {
           aCompilerTool = "VFFortranCompilerTool";
@@ -1479,6 +1480,7 @@ void cmLocalVisualStudio7Generator
         if(ext == "rc")
           {
           aCompilerTool = "VCResourceCompilerTool";  
+          lang = "RC";
           if(this->FortranProject)
             {
             aCompilerTool = "VFResourceCompilerTool";
@@ -1520,7 +1522,7 @@ void cmLocalVisualStudio7Generator
             fileOptions.OutputAdditionalOptions(fout, "\t\t\t\t\t", "\n");
             fileOptions.OutputFlagMap(fout, "\t\t\t\t\t");
             fileOptions.OutputPreprocessorDefinitions(fout,
-                                                      "\t\t\t\t\t", "\n");
+                                                      "\t\t\t\t\t", "\n", 
lang);
             }
           if(!fc.AdditionalDeps.empty())
             {
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx 
b/Source/cmVisualStudio10TargetGenerator.cxx
index 2d55e1e..4cb745e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -717,6 +717,10 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
       // is ended on a new line
       this->WriteString("</ClCompile>\n", 2);
       }
+    else if(!header && rc && this->OutputSourceSpecificFlags(*source))
+      {
+      this->WriteString("</ResourceCompile>\n", 2);
+      }
     else
       {
       (*this->BuildFileStream ) << " />\n";
@@ -853,8 +857,7 @@ bool 
cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
       clOptions.OutputAdditionalOptions(*this->BuildFileStream, "      ", "");
       clOptions.OutputFlagMap(*this->BuildFileStream, "      "); 
       clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream,
-                                              "      ", "\n");
-      
+                                              "      ", "\n", lang);
       }
     }
   return hasFlags;
@@ -1120,7 +1123,7 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
     }
 
   clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ", 
-                                          "\n");
+                                          "\n", "CXX");
   this->WriteString("<AssemblerListingLocation>", 3);
   *this->BuildFileStream << configName 
                          << "</AssemblerListingLocation>\n";
@@ -1155,7 +1158,7 @@ WriteRCOptions(std::string const& configName,
   this->WriteString("<ResourceCompile>\n", 2);
   Options& clOptions = *(this->ClOptions[configName]);
   clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, "      ",
-                                          "\n");
+                                          "\n", "RC");
   this->OutputIncludes(includes);
   this->WriteString("</ResourceCompile>\n", 2);
 }
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx 
b/Source/cmVisualStudioGeneratorOptions.cxx
index 9acae0d..ed0d60c 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -204,7 +204,8 @@ void
 cmVisualStudioGeneratorOptions
 ::OutputPreprocessorDefinitions(std::ostream& fout,
                                 const char* prefix,
-                                const char* suffix)
+                                const char* suffix,
+                                const char* lang)
 {
   if(this->Defines.empty())
     {
@@ -251,6 +252,11 @@ cmVisualStudioGeneratorOptions
     if(this->Version == 10)
       {
       define = cmVisualStudio10GeneratorOptionsEscapeForXML(define.c_str());
+
+      if(0 == strcmp(lang, "RC"))
+        {
+        cmSystemTools::ReplaceString(define, "\"", "\\\"");
+        }
       }
     else
       {
diff --git a/Source/cmVisualStudioGeneratorOptions.h 
b/Source/cmVisualStudioGeneratorOptions.h
index 8619ba0..fadc4b5 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -54,7 +54,8 @@ public:
   // Write options to output.
   void OutputPreprocessorDefinitions(std::ostream& fout,
                                      const char* prefix,
-                                     const char* suffix);
+                                     const char* suffix,
+                                     const char* lang);
   void OutputFlagMap(std::ostream& fout, const char* indent);
   void OutputAdditionalOptions(std::ostream& fout,
                                const char* prefix,
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index e842955..8c14f8d 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -1,7 +1,13 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required(VERSION 2.8.3.20110118)
 project (VSResource)
-add_definitions(/DCMAKE_RCDEFINE="test.txt")
+
 string(REPLACE "/INCREMENTAL:YES" ""
   CMAKE_EXE_LINKER_FLAGS_DEBUG
   "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt
+  "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" COPYONLY)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt")
+
 add_executable(VSResource main.cpp test.rc)
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
index 8aab8b7..2e87a68 100644
--- a/Tests/VSResource/test.rc
+++ b/Tests/VSResource/test.rc
@@ -1,5 +1,10 @@
 #ifdef CMAKE_RCDEFINE
 hello TEXT DISCARDABLE CMAKE_RCDEFINE
+
+STRINGTABLE
+BEGIN
+  1 CMAKE_RCDEFINE
+END
 #else
 #error "resource compiler did not get defines from command line!"
-#endif
\ No newline at end of file
+#endif

-----------------------------------------------------------------------

Summary of changes:
 Source/cmLocalVisualStudio7Generator.cxx   |    8 +++++---
 Source/cmVisualStudio10TargetGenerator.cxx |   11 +++++++----
 Source/cmVisualStudioGeneratorOptions.cxx  |    8 +++++++-
 Source/cmVisualStudioGeneratorOptions.h    |    3 ++-
 Tests/VSResource/CMakeLists.txt            |   10 ++++++++--
 Tests/VSResource/test.rc                   |    7 ++++++-
 6 files changed, 35 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to