[Cmake-commits] CMake branch, next, updated. v2.8.7-3350-gcee132f

Alexander Neundorf neundorf at kde.org
Mon Mar 26 16:16:37 EDT 2012


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  cee132f0cea0c8ff7e6cb0c0ec3b3c3987c4bc5c (commit)
       via  9b32475587c1b7a911e5c635611c1fe5296b8740 (commit)
       via  2066511ca9a0b86d45e07357ebec8dd07f1c93b9 (commit)
       via  c652812af741c2468ad5b58e789244700aa51be5 (commit)
      from  4b37c3cb6fe6282e82b8d5bd52e51254153be2f7 (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=cee132f0cea0c8ff7e6cb0c0ec3b3c3987c4bc5c
commit cee132f0cea0c8ff7e6cb0c0ec3b3c3987c4bc5c
Merge: 4b37c3c 9b32475
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Mar 26 16:16:36 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 26 16:16:36 2012 -0400

    Merge topic 'AutomocProperCMakeEscaping_13018' into next
    
    9b32475 automoc: add define to test which caused bug #13018
    2066511 automoc: fix #13018, proper cmake escaping to avoid false rebuilds
    c652812 make cmLocalGenerator::EscapeForCMake() static


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b32475587c1b7a911e5c635611c1fe5296b8740
commit 9b32475587c1b7a911e5c635611c1fe5296b8740
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Mon Mar 26 22:11:46 2012 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Mar 26 22:11:46 2012 +0200

    automoc: add define to test which caused bug #13018
    
    This does not really test that the bug is fixed, but at least it makes
    it easy to check manually whether the bug is there or not.
    I have to see whether I can build a test which does test that
    a target is not rebuilt everytime.
    
    Alex

diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index d255a5a..5e3686d 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -8,7 +8,7 @@ include(UseQt4)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-add_definitions(-DFOO)
+add_definitions(-DFOO -DSomeDefine="Barx")
 
 # enable relaxed mode so automoc can handle all the special cases:
 set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2066511ca9a0b86d45e07357ebec8dd07f1c93b9
commit 2066511ca9a0b86d45e07357ebec8dd07f1c93b9
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Tue Mar 20 22:52:05 2012 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Mar 26 21:45:27 2012 +0200

    automoc: fix #13018, proper cmake escaping to avoid false rebuilds
    
    The variables stored in the AutomocInfo.cmake file were not properly
    escaped, so when reading them back they could turn into lists, if they
    contained double quotes initially.
    This patch fixes this by using cmLocalGenerator::EscapeForCMake() to
    escape the variables properly.
    
    Alex

diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 29dab97..13f2161 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/Modules/AutomocInfo.cmake.in
@@ -1,9 +1,9 @@
-set(AM_SOURCES "@_moc_files@" )
-set(AM_HEADERS "@_moc_headers@" )
-set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@")
-set(AM_MOC_DEFINITIONS "@_moc_defs@")
-set(AM_MOC_INCLUDES "@_moc_incs@")
-set(AM_MOC_OPTIONS "@_moc_options@")
+set(AM_SOURCES @_moc_files@ )
+set(AM_HEADERS @_moc_headers@ )
+set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
+set(AM_MOC_DEFINITIONS @_moc_defs@)
+set(AM_MOC_INCLUDES @_moc_incs@)
+set(AM_MOC_OPTIONS @_moc_options@)
 set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
 set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/")
 set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/")
@@ -12,5 +12,5 @@ set(AM_CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@/")
 set(AM_CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/")
 set(AM_QT_VERSION_MAJOR "@QT_VERSION_MAJOR@" )
 set(AM_Qt5Core_VERSION_MAJOR "@Qt5Core_VERSION_MAJOR@" )
-set(AM_TARGET_NAME "@_moc_target_name@")
+set(AM_TARGET_NAME @_moc_target_name@)
 set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 0d0d80c..8b899bc 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -202,13 +202,20 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   cmMakefile::ScopePushPop varScope(makefile);
   static_cast<void>(varScope);
 
-  makefile->AddDefinition("_moc_target_name", automocTargetName.c_str());
-  makefile->AddDefinition("_moc_incs", _moc_incs.c_str());
-  makefile->AddDefinition("_moc_defs", _moc_defs.c_str());
-  makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str());
-  makefile->AddDefinition("_moc_options", _moc_options.c_str());
-  makefile->AddDefinition("_moc_files", _moc_files.c_str());
-  makefile->AddDefinition("_moc_headers", _moc_headers.c_str());
+  makefile->AddDefinition("_moc_target_name",
+          cmLocalGenerator::EscapeForCMake(automocTargetName.c_str()).c_str());
+  makefile->AddDefinition("_moc_incs",
+          cmLocalGenerator::EscapeForCMake(_moc_incs.c_str()).c_str());
+  makefile->AddDefinition("_moc_defs",
+          cmLocalGenerator::EscapeForCMake(_moc_defs.c_str()).c_str());
+  makefile->AddDefinition("_moc_compile_defs",
+          cmLocalGenerator::EscapeForCMake(_moc_compile_defs.c_str()).c_str());
+  makefile->AddDefinition("_moc_options",
+          cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str());
+  makefile->AddDefinition("_moc_files",
+          cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str());
+  makefile->AddDefinition("_moc_headers",
+          cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str());
   makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
@@ -340,8 +347,9 @@ void cmQtAutomoc::WriteOldMocDefinitionsFile(const char* targetDirectory)
   std::fstream outfile;
   outfile.open(filename.c_str(),
                std::ios::out | std::ios::trunc);
-  outfile << "set(AM_OLD_MOC_DEFINITIONS \""
-              << this->Join(this->MocDefinitions, ' ') << "\")\n";
+  outfile << "set(AM_OLD_MOC_DEFINITIONS "
+              << cmLocalGenerator::EscapeForCMake(
+                       this->Join(this->MocDefinitions, ' ').c_str()) << ")\n";
 
   outfile.close();
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c652812af741c2468ad5b58e789244700aa51be5
commit c652812af741c2468ad5b58e789244700aa51be5
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Tue Mar 20 22:50:44 2012 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Mar 26 21:45:07 2012 +0200

    make cmLocalGenerator::EscapeForCMake() static
    
    This way it can be used also if there is no cmLocalGenerator instance around
    
    Alex

diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 124747b..3e93819 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -251,7 +251,7 @@ public:
   std::string EscapeForShellOldStyle(const char* str);
 
   /** Escape the given string as an argument in a CMake script.  */
-  std::string EscapeForCMake(const char* str);
+  static std::string EscapeForCMake(const char* str);
 
   enum FortranFormat
     {

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

Summary of changes:
 Modules/AutomocInfo.cmake.in   |   14 +++++++-------
 Source/cmLocalGenerator.h      |    2 +-
 Source/cmQtAutomoc.cxx         |   26 +++++++++++++++++---------
 Tests/QtAutomoc/CMakeLists.txt |    2 +-
 4 files changed, 26 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list