[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5242-g21c6d4a

Stephen Kelly steveire at gmail.com
Mon Nov 18 04:22:57 EST 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  21c6d4aea1c66adf86f10b1e195c3392883f523c (commit)
       via  53f148947c454b925504b4ec6bcce89cfa3397e7 (commit)
      from  edfc2781298559e1baf8e1cea937cc4f2ea3535d (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=21c6d4aea1c66adf86f10b1e195c3392883f523c
commit 21c6d4aea1c66adf86f10b1e195c3392883f523c
Merge: edfc278 53f1489
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 18 04:22:49 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 18 04:22:49 2013 -0500

    Merge topic 'autogen-depends' into next
    
    53f1489 cmQtAutogen: Allow specifying depends for autogen targets.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53f148947c454b925504b4ec6bcce89cfa3397e7
commit 53f148947c454b925504b4ec6bcce89cfa3397e7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 18 08:09:56 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 18 10:22:39 2013 +0100

    cmQtAutogen: Allow specifying depends for autogen targets.
    
    Test this by generating files with a custom target, which require
    processing by automoc.
    
    Lift the restriction of automoc on processing generated files. Instead,
    mark the generated _automoc file as skipped for automoc purposes.

diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 36cb368..3a5056a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -204,6 +204,11 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
                                     "", makefile->GetCurrentOutputDirectory());
 
   std::vector<std::string> depends;
+  if (const char *autogenDepends =
+                                target->GetProperty("AUTOGEN_TARGET_DEPENDS"))
+    {
+    cmSystemTools::ExpandListArgument(autogenDepends, depends);
+    }
   std::vector<std::string> toolNames;
   if (target->GetPropertyAsBool("AUTOMOC"))
     {
@@ -442,9 +447,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
     std::string absFile = cmsys::SystemTools::GetRealPath(
                                                     sf->GetFullPath().c_str());
     bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
-    bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
 
-    if (!generated)
+    if (absFile.find("_automoc.cpp") == std::string::npos)
       {
       if (skip)
         {
@@ -1327,6 +1331,9 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
                std::ios::out | std::ios::trunc);
   outfile << automocSource;
   outfile.close();
+  cmSourceFile* automocCppSource
+          = makefile->GetOrCreateSource(this->OutMocCppFilename.c_str(), true);
+  automocCppSource->SetProperty("SKIP_AUTOMOC", "1");
 
   return true;
 }
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 7991c4e..54d24a0 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -43,10 +43,19 @@ add_library(codeeditorLib STATIC codeeditor.cpp)
 
 add_library(privateSlot OBJECT private_slot.cpp)
 
+add_custom_target(generate_moc_input
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
+  COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/generated.h.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.h"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}"
+  COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/generated.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.cpp"
+)
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/generated.cpp" PROPERTIES GENERATED TRUE)
+
 add_executable(QtAutogen main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp
                xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot>
-               test.qrc resourcetester.cpp
+               test.qrc resourcetester.cpp "${CMAKE_CURRENT_BINARY_DIR}/generated.cpp"
 )
+set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input)
 
 set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE)
 
diff --git a/Tests/QtAutogen/generated.cpp.in b/Tests/QtAutogen/generated.cpp.in
new file mode 100644
index 0000000..f53bf53
--- /dev/null
+++ b/Tests/QtAutogen/generated.cpp.in
@@ -0,0 +1,10 @@
+
+#include "generated.h"
+
+Generated::Generated(QObject *parent)
+  : QObject(parent)
+{
+
+}
+
+#include "moc_generated.cpp"
diff --git a/Tests/QtAutogen/generated.h.in b/Tests/QtAutogen/generated.h.in
new file mode 100644
index 0000000..5422f02
--- /dev/null
+++ b/Tests/QtAutogen/generated.h.in
@@ -0,0 +1,14 @@
+
+#ifndef GENERATED_H
+#define GENERATED_H
+
+#include <QObject>
+
+class Generated : public QObject
+{
+  Q_OBJECT
+public:
+  explicit Generated(QObject *parent = 0);
+};
+
+#endif

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list