[Cmake-commits] CMake branch, next, updated. v2.8.6-2287-gb32ec62

Alexander Neundorf neundorf at kde.org
Mon Dec 19 16:44:36 EST 2011


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  b32ec62b035ed6d51d5313642c6d16927ecd62c3 (commit)
       via  e474dcb23197489640456b46862a5aa7019834a5 (commit)
       via  96fc5d5d0701c98a5029469c8a9dcc6aa6576278 (commit)
      from  bf5421d785dfc1e55623fd37f35166c6d1c7d6e4 (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=b32ec62b035ed6d51d5313642c6d16927ecd62c3
commit b32ec62b035ed6d51d5313642c6d16927ecd62c3
Merge: bf5421d e474dcb
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Dec 19 16:44:34 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Dec 19 16:44:34 2011 -0500

    Merge topic 'AutomocFineTuning' into next
    
    e474dcb automoc: improved warning message in relaxed mode
    96fc5d5 automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e474dcb23197489640456b46862a5aa7019834a5
commit e474dcb23197489640456b46862a5aa7019834a5
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Dec 14 19:12:15 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Dec 14 19:12:15 2011 +0100

    automoc: improved warning message in relaxed mode
    
    Alex

diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 0b97436..0d0d80c 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -698,8 +698,9 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
                             "includes the moc file \"" << currentMoc <<
                             "\", but does not contain a Q_OBJECT macro. "
                             "Running moc on "
-                        << "\"" << headerToMoc << "\" ! Better include \"moc_"
-                        << basename << ".cpp\" for a robust build.\n"
+                        << "\"" << headerToMoc << "\" ! Include \"moc_"
+                        << basename << ".cpp\" for a compatiblity with "
+                           "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"
                         << std::endl;
               }
             else
@@ -708,8 +709,9 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
                             "includes the moc file \"" << currentMoc <<
                             "\" instead of \"moc_" << basename << ".cpp\". "
                             "Running moc on "
-                        << "\"" << headerToMoc << "\" ! Better include \"moc_"
-                        << basename << ".cpp\" for a robust build.\n"
+                        << "\"" << headerToMoc << "\" ! Include \"moc_"
+                        << basename << ".cpp\" for compatiblity with "
+                           "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"
                         << std::endl;
               }
             }
@@ -749,7 +751,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
                    "includes "
                 << "\"" << ownMocUnderscoreFile  << "\". Running moc on "
                 << "\"" << absFilename << "\" ! Better include \""
-                << scannedFileBasename << ".moc\" for a robust build.\n"
+                << scannedFileBasename << ".moc\" for compatiblity with "
+                   "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n"
                 << std::endl;
       includedMocs[absFilename] = ownMocUnderscoreFile;
       includedMocs.erase(ownMocHeaderFile);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96fc5d5d0701c98a5029469c8a9dcc6aa6576278
commit 96fc5d5d0701c98a5029469c8a9dcc6aa6576278
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Tue Dec 13 22:11:47 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Tue Dec 13 22:11:47 2011 +0100

    automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
    
    automoc now defaults to strict mode, also with Qt4, i.e. it behaves as
    the documentation says by default. I also inverted the switch
    CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE.
    Docs and test adapted accordingly.
    
    Alex

diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 44f2da2..29dab97 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/Modules/AutomocInfo.cmake.in
@@ -13,4 +13,4 @@ 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_STRICT_MODE "@_moc_strict_mode@")
+set(AM_RELAXED_MODE "@_moc_relaxed_mode@")
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index a0632a2..fe29df9 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -508,16 +508,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "Variables That Change Behavior");
 
     cm->DefineProperty
-    ("CMAKE_AUTOMOC_STRICT_MODE",  cmProperty::VARIABLE,
+    ("CMAKE_AUTOMOC_RELAXED_MODE",  cmProperty::VARIABLE,
      "Switch between strict and relaxed automoc mode.",
-     "When TRUE, automoc behaves exactly as described in the documentation "
+     "By default, automoc behaves exactly as described in the documentation "
      "of the AUTOMOC target property.  "
-     "When set to FALSE, it accepts more input and tries to find the correct "
+     "When set to TRUE, it accepts more input and tries to find the correct "
      "input file for moc even if it differs from the documented behaviour. "
      "In this mode it e.g. also checks whether a header file is intended to "
      "be processed by moc when a \"foo.moc\" file has been included.\n"
-     "When using Qt4, CMAKE_AUTOMOC_STRICT_MODE is initialized to FALSE. "
-     "It also has to be set to FALSE for KDE4 compatibility.",
+     "Relaxed mode has to be enabled for KDE4 compatibility.",
      false,
      "Variables That Change Behavior");
 
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 65c7952..0b97436 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -119,11 +119,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
     return;
     }
 
-  bool strictMode = (qtMajorVersion == "5");
-  if (makefile->IsDefinitionSet("CMAKE_AUTOMOC_STRICT_MODE"))
-    {
-    strictMode = makefile->IsOn("CMAKE_AUTOMOC_STRICT_MODE");
-    }
+  bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
 
   // create a custom target for running automoc at buildtime:
   std::string automocTargetName = targetName;
@@ -213,7 +209,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   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_strict_mode", strictMode ? "TRUE" : "FALSE");
+  makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
 
   const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
   std::string inputFile = cmakeRoot;
@@ -313,7 +309,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
   this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR");
   this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME");
 
-  this->StrictMode = makefile->IsOn("AM_STRICT_MODE");
+  this->RelaxedMode = makefile->IsOn("AM_RELAXED_MODE");
 
   return true;
 }
@@ -509,7 +505,7 @@ bool cmQtAutomoc::RunAutomoc()
       {
       std::cout << "AUTOMOC: Checking " << absFilename << std::endl;
       }
-    if (this->StrictMode == false)
+    if (this->RelaxedMode)
       {
       this->ParseCppFile(absFilename, headerExtensions, includedMocs);
       }
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h
index a31f36a..8cbbac1 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutomoc.h
@@ -85,7 +85,7 @@ private:
   bool ColorOutput;
   bool RunMocFailed;
   bool GenerateAll;
-  bool StrictMode;
+  bool RelaxedMode;
 
 };
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fc3c1c9..6a937b8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -162,7 +162,7 @@ void cmTarget::DefineProperties(cmake *cm)
      "CMAKE_AUTOMOC if it is set when a target is created.\n"
      "Additional command line options for moc can be set via the "
      "AUTOMOC_MOC_OPTIONS property.\n"
-     "By setting the CMAKE_AUTOMOC_STRICT_MODE variable to FALSE the rules "
+     "By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules "
      "for searching the files which will be processed by moc can be relaxed. "
      "See the documentation for this variable for more details.");
 
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index ebfb4f5..d255a5a 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -10,6 +10,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 add_definitions(-DFOO)
 
+# enable relaxed mode so automoc can handle all the special cases:
+set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
+
 # create an executable and a library target, both requiring automoc:
 add_library(codeeditorLib STATIC codeeditor.cpp)
 

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

Summary of changes:
 Modules/AutomocInfo.cmake.in   |    2 +-
 Source/cmDocumentVariables.cxx |    9 ++++-----
 Source/cmQtAutomoc.cxx         |   25 ++++++++++++-------------
 Source/cmQtAutomoc.h           |    2 +-
 Source/cmTarget.cxx            |    2 +-
 Tests/QtAutomoc/CMakeLists.txt |    3 +++
 6 files changed, 22 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list