[Cmake-commits] CMake branch, next, updated. v3.0.2-5728-g4326991

Brad King brad.king at kitware.com
Mon Oct 13 08:20:52 EDT 2014


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  4326991b9a6da0c3a7082631fe450445febf2df2 (commit)
       via  f4c5eade787f4f0a6e33fe029c2816580db06041 (commit)
      from  be020c8aba4bd3c3f84515efc5a3352b103bfd1f (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=4326991b9a6da0c3a7082631fe450445febf2df2
commit 4326991b9a6da0c3a7082631fe450445febf2df2
Merge: be020c8 f4c5ead
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 13 08:20:51 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 13 08:20:51 2014 -0400

    Merge topic 'fix-ninja-rc-include-flags' into next
    
    f4c5eade Ninja: Fix RC include directories regression


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4c5eade787f4f0a6e33fe029c2816580db06041
commit f4c5eade787f4f0a6e33fe029c2816580db06041
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 10 09:57:07 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 13 08:20:05 2014 -0400

    Ninja: Fix RC include directories regression
    
    Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags
    output formatting, 2014-03-04) caused Windows Resource Compiler include
    directories to be computed as relative paths in the Ninja generator.
    This breaks the cmcldeps handling of include paths.  The reason for the
    regression is that several cmLocalGenerator::GetIncludeFlags callers
    treated the fourth "bool forResponseFile" argument as if it controlled
    whether include directories were a full path.  It actually did control
    that by accident until the above commit.
    
    Add an explicit "bool forceFullPaths" argument to GetIncludeFlags
    and thread the value through ConvertToIncludeReference as needed.
    Update GetIncludeFlags call sites that really wanted to control the
    forResponseFile setting to be aware of the new argument.  Extend the
    VSResource test to cover this case.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4bd9191..50e279b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1287,9 +1287,11 @@ cmLocalGenerator::ConvertToOutputForExisting(RelativeRoot remote,
 //----------------------------------------------------------------------------
 std::string
 cmLocalGenerator::ConvertToIncludeReference(std::string const& path,
-                                            OutputFormat format)
+                                            OutputFormat format,
+                                            bool forceFullPaths)
 {
-  return this->ConvertToOutputForExisting(path, START_OUTPUT, format);
+  return this->ConvertToOutputForExisting(
+    path, forceFullPaths? FULL : START_OUTPUT, format);
 }
 
 //----------------------------------------------------------------------------
@@ -1297,6 +1299,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
                                      const std::vector<std::string> &includes,
                                      cmGeneratorTarget* target,
                                      const std::string& lang,
+                                     bool forceFullPaths,
                                      bool forResponseFile,
                                      const std::string& config)
 {
@@ -1401,7 +1404,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
       flagUsed = true;
       }
     std::string includePath =
-      this->ConvertToIncludeReference(*i, shellFormat);
+      this->ConvertToIncludeReference(*i, shellFormat, forceFullPaths);
     if(quotePaths && includePath.size() && includePath[0] != '\"')
       {
       includeFlags << "\"";
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b25b9ab..3a9d5be 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -160,6 +160,7 @@ public:
   std::string GetIncludeFlags(const std::vector<std::string> &includes,
                               cmGeneratorTarget* target,
                               const std::string& lang,
+                              bool forceFullPaths = false,
                               bool forResponseFile = false,
                               const std::string& config = "");
 
@@ -215,7 +216,8 @@ public:
                                          OutputFormat format = SHELL);
 
   virtual std::string ConvertToIncludeReference(std::string const& path,
-                                                OutputFormat format = SHELL);
+                                                OutputFormat format = SHELL,
+                                                bool forceFullPaths = false);
 
   /** Called from command-line hook to clear dependencies.  */
   virtual void ClearDependencies(cmMakefile* /* mf */,
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 5522e0d..398b55a 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -151,9 +151,10 @@ cmLocalNinjaGenerator::ConvertToLinkReference(std::string const& lib,
 
 std::string
 cmLocalNinjaGenerator::ConvertToIncludeReference(std::string const& path,
-                                                 OutputFormat format)
+                                                 OutputFormat format,
+                                                 bool forceFullPaths)
 {
-  return this->Convert(path, HOME_OUTPUT, format);
+  return this->Convert(path, forceFullPaths? FULL : HOME_OUTPUT, format);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index c787ac6..1d27224 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -108,7 +108,8 @@ public:
 
 protected:
   virtual std::string ConvertToIncludeReference(std::string const& path,
-                                                OutputFormat format = SHELL);
+                                                OutputFormat format = SHELL,
+                                                bool forceFullPaths = false);
 
 
 private:
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7849d12..1f8f686 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1962,7 +1962,7 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
 
   std::string includeFlags =
     this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget,
-                                          lang, useResponseFile);
+                                          lang, false, useResponseFile);
   if(includeFlags.empty())
     {
     return;
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index c5cb336..17eb041 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -18,6 +18,11 @@ if(CMAKE_RC_COMPILER MATCHES windres)
   message(STATUS "CMAKE_RC_COMPILER MATCHES windres")
   add_definitions(/DCMAKE_RCDEFINE=test.txt)
   add_definitions(/DCMAKE_RCDEFINE_NO_QUOTED_STRINGS)
+  if(MSYS AND CMAKE_CURRENT_BINARY_DIR MATCHES " ")
+    # windres cannot handle spaces in include dir, and
+    # for the MSys shell we do not convert to shortpath.
+    set(CMAKE_RC_NO_INCLUDE 1)
+  endif()
 elseif(MSVC60)
   # VS6 rc compiler does not deal well with spaces in a "/D" value, but it can
   # handle the quoting
@@ -30,10 +35,17 @@ else()
   set(TEXTFILE_FROM_SOURCE_DIR "textfile, spaces in name, from binary dir")
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test.txt
     "${CMAKE_CURRENT_BINARY_DIR}/test with spaces.txt" @ONLY)
-  include_directories(${CMAKE_CURRENT_BINARY_DIR})
   add_definitions(/DCMAKE_RCDEFINE="test with spaces.txt")
 endif()
 
+if(CMAKE_RC_NO_INCLUDE)
+  add_definitions(/DCMAKE_RC_NO_INCLUDE)
+else()
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include.rc.in
+    "${CMAKE_CURRENT_BINARY_DIR}/include.rc" @ONLY)
+  include_directories(${CMAKE_CURRENT_BINARY_DIR})
+endif()
+
 add_executable(VSResource main.cpp test.rc)
 
 set_property(TARGET VSResource
diff --git a/Tests/VSResource/include.rc.in b/Tests/VSResource/include.rc.in
new file mode 100644
index 0000000..f0f6859
--- /dev/null
+++ b/Tests/VSResource/include.rc.in
@@ -0,0 +1 @@
+// This file should be included.
diff --git a/Tests/VSResource/test.rc b/Tests/VSResource/test.rc
index 4ce4b53..0de4683 100644
--- a/Tests/VSResource/test.rc
+++ b/Tests/VSResource/test.rc
@@ -1,4 +1,7 @@
 #ifdef CMAKE_RCDEFINE
+# ifndef CMAKE_RC_NO_INCLUDE
+#  include <include.rc>
+# endif
 
 // This line can compile with either an unquoted or a quoted string
 1025 TEXTFILE CMAKE_RCDEFINE

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list