[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2695-gb01cd26

Brad King brad.king at kitware.com
Mon Apr 1 09:59:48 EDT 2013


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  b01cd269cc17018e091b418d22c1e99c797bcd53 (commit)
       via  20c99b1dbcdf87e9bf43f216c6903157c826e036 (commit)
       via  969a7fde7a82b17cae4bb6955435665eb5d3e979 (commit)
      from  b9762ee25023eb526d916c422c0e04ade666c476 (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=b01cd269cc17018e091b418d22c1e99c797bcd53
commit b01cd269cc17018e091b418d22c1e99c797bcd53
Merge: b9762ee 20c99b1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 1 09:59:46 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Apr 1 09:59:46 2013 -0400

    Merge topic 'automoc-vs11-workaround' into next
    
    20c99b1 automoc: Use a pre-build event in VS >= 7
    969a7fd CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20c99b1dbcdf87e9bf43f216c6903157c826e036
commit 20c99b1dbcdf87e9bf43f216c6903157c826e036
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 29 15:56:13 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 29 15:58:21 2013 -0400

    automoc: Use a pre-build event in VS >= 7
    
    In VS IDE generators add a pre-build event to perform automoc instead of
    using a separate custom target.  This reduces the number of targets in the
    .sln that need to be loaded by the IDE.
    
    This also works around a VS 11 bug as discussed in issue 13900.
    
    Suggested-by: Hauke Heibel <hauke.heibel at gmail.com>

diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index c7060b0..a1fa31f 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -17,6 +17,10 @@
 #include "cmSourceFile.h"
 #include "cmSystemTools.h"
 
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# include "cmLocalVisualStudioGenerator.h"
+#endif
+
 #include <cmsys/Terminal.h>
 #include <cmsys/ios/sstream>
 
@@ -182,14 +186,44 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
   std::string automocComment = "Automoc for target ";
   automocComment += targetName;
 
-  cmTarget* automocTarget = makefile->AddUtilityCommand(
-                              automocTargetName.c_str(), true,
-                              workingDirectory.c_str(), depends,
-                              commandLines, false, automocComment.c_str());
-  // inherit FOLDER property from target (#13688)
-  copyTargetProperty(automocTarget, target, "FOLDER");
-
-  target->AddUtility(automocTargetName.c_str());
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  bool usePRE_BUILD = false;
+  cmGlobalGenerator* gg = localGen->GetGlobalGenerator();
+  if(strstr(gg->GetName(), "Visual Studio"))
+    {
+    cmLocalVisualStudioGenerator* vslg =
+      static_cast<cmLocalVisualStudioGenerator*>(localGen);
+    // Under VS >= 7 use a PRE_BUILD event instead of a separate target to
+    // reduce the number of targets loaded into the IDE.
+    // This also works around a VS 11 bug that may skip updating the target:
+    //  https://connect.microsoft.com/VisualStudio/feedback/details/769495
+    usePRE_BUILD = vslg->GetVersion() >= cmLocalVisualStudioGenerator::VS7;
+    }
+  if(usePRE_BUILD)
+    {
+    // Add the pre-build command directly to bypass the OBJECT_LIBRARY
+    // rejection in cmMakefile::AddCustomCommandToTarget because we know
+    // PRE_BUILD will work for an OBJECT_LIBRARY in this specific case.
+    std::vector<std::string> no_output;
+    cmCustomCommand cc(makefile, no_output, depends,
+                       commandLines, automocComment.c_str(),
+                       workingDirectory.c_str());
+    cc.SetEscapeOldStyle(false);
+    cc.SetEscapeAllowMakeVars(true);
+    target->GetPreBuildCommands().push_back(cc);
+    }
+  else
+#endif
+    {
+    cmTarget* automocTarget = makefile->AddUtilityCommand(
+                                automocTargetName.c_str(), true,
+                                workingDirectory.c_str(), depends,
+                                commandLines, false, automocComment.c_str());
+    // inherit FOLDER property from target (#13688)
+    copyTargetProperty(automocTarget, target, "FOLDER");
+
+    target->AddUtility(automocTargetName.c_str());
+    }
 
   // configure a file to get all information to automoc at buildtime:
   std::string _moc_files;

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

Summary of changes:
 Source/CMakeVersion.cmake |    2 +-
 Source/cmQtAutomoc.cxx    |   50 +++++++++++++++++++++++++++++++++++++-------
 2 files changed, 43 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list