[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5797-ga2cec72
Stephen Kelly
steveire at gmail.com
Mon Nov 25 16:42:28 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 a2cec72ade8a1b0990ceb269bdea371527e2b7a5 (commit)
via 1320e0768e57754b51294a00480927d50176bf02 (commit)
from 6230a8ece178a6c7ffd8370488af96d484f115ed (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=a2cec72ade8a1b0990ceb269bdea371527e2b7a5
commit a2cec72ade8a1b0990ceb269bdea371527e2b7a5
Merge: 6230a8e 1320e07
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 25 16:42:11 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 25 16:42:11 2013 -0500
Merge topic 'autogen-depends' into next
1320e07 cmQtAutogen: Allow specifying depends for autogen targets.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1320e0768e57754b51294a00480927d50176bf02
commit 1320e0768e57754b51294a00480927d50176bf02
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 25 22:41:21 2013 +0100
cmQtAutogen: Allow specifying depends for autogen targets.
Test this by generating files with a custom target, which moc
requires to be present when it is run.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index abc6fde..2a121da 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -80,6 +80,7 @@ Properties on Targets
/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY
/prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
+ /prop_tgt/AUTOGEN_TARGET_DEPENDS
/prop_tgt/AUTOMOC_MOC_OPTIONS
/prop_tgt/AUTOMOC
/prop_tgt/AUTOUIC
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
new file mode 100644
index 0000000..006c83a
--- /dev/null
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -0,0 +1,14 @@
+AUTOGEN_TARGET_DEPENDS
+----------------------
+
+Target dependencies of the corresponding ``_automoc`` target.
+
+Targets which have their :prop_tgt:`AUTOMOC` target set to true have a
+corresponding ``_automoc`` target which is used to autogenerate generate moc
+files. As this ``_automoc`` target is created at generate-time, it is not
+possible to define dependencies of it, such as to create inputs for the moc
+executable.
+
+The ``AUTOGEN_TARGET_DEPENDS`` target can be set instead to a list of dependencies
+for the ``_automoc`` target. The buildsystem will be generated to depend on its
+contents.
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 35717ce..a7d20ae 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"))
{
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 7991c4e..9dd5289 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -43,10 +43,17 @@ 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}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h"
+)
+# set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" 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 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 b/Tests/QtAutogen/generated.cpp
new file mode 100644
index 0000000..f53bf53
--- /dev/null
+++ b/Tests/QtAutogen/generated.cpp
@@ -0,0 +1,10 @@
+
+#include "generated.h"
+
+Generated::Generated(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+#include "moc_generated.cpp"
diff --git a/Tests/QtAutogen/generated.h b/Tests/QtAutogen/generated.h
new file mode 100644
index 0000000..dd22489
--- /dev/null
+++ b/Tests/QtAutogen/generated.h
@@ -0,0 +1,17 @@
+
+#ifndef GENERATED_H
+#define GENERATED_H
+
+#include <QObject>
+
+#include "myinterface.h"
+
+class Generated : public QObject, MyInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(MyInterface)
+public:
+ explicit Generated(QObject *parent = 0);
+};
+
+#endif
diff --git a/Tests/QtAutogen/myinterface.h.in b/Tests/QtAutogen/myinterface.h.in
new file mode 100644
index 0000000..c6c0ba1
--- /dev/null
+++ b/Tests/QtAutogen/myinterface.h.in
@@ -0,0 +1,14 @@
+
+#ifndef MYINTERFACE_H
+#define MYINTERFACE_H
+
+#include <QObject>
+
+class MyInterface
+{
+
+};
+
+Q_DECLARE_INTERFACE(MyInterface, "org.cmake.example.MyInterface")
+
+#endif
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-properties.7.rst | 1 +
Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst | 14 ++++++++++++++
Source/cmQtAutoGenerators.cxx | 5 +++++
Tests/QtAutogen/CMakeLists.txt | 9 ++++++++-
Tests/QtAutogen/generated.cpp | 10 ++++++++++
Tests/QtAutogen/generated.h | 17 +++++++++++++++++
.../myinterface.h => QtAutogen/myinterface.h.in} | 2 ++
7 files changed, 57 insertions(+), 1 deletions(-)
create mode 100644 Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
create mode 100644 Tests/QtAutogen/generated.cpp
create mode 100644 Tests/QtAutogen/generated.h
copy Tests/{Qt4Targets/interface/myinterface.h => QtAutogen/myinterface.h.in} (87%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list