summaryrefslogtreecommitdiffstats
path: root/Tests/Qt4Targets/IncrementalMoc
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-04 10:03:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-21 10:14:41 (GMT)
commit734df96f5ad3d47b3c7825715f0b524292aa6ede (patch)
tree8112056a1aa1461ee85c1952d3f04efa7927a90a /Tests/Qt4Targets/IncrementalMoc
parent0f79dab48bf17e867fe19a7b7140fa7513f4b72d (diff)
downloadCMake-734df96f5ad3d47b3c7825715f0b524292aa6ede.zip
CMake-734df96f5ad3d47b3c7825715f0b524292aa6ede.tar.gz
CMake-734df96f5ad3d47b3c7825715f0b524292aa6ede.tar.bz2
Qt4: Fix moc command dependencies for incremental build.
Since commit v2.8.12~327^2 (Qt4Macros: Allow specifying a TARGET in invokations of macros., 2013-02-26), a parameters file is populated with moc arguments at generate-time. When the compile definitions or include directories change, the parameters file is updated but moc is not re-run in response. Fix that by making the moc invocation depend on the parameters file. Reported-At: https://bugreports.qt-project.org/browse/QTBUG-36970
Diffstat (limited to 'Tests/Qt4Targets/IncrementalMoc')
-rw-r--r--Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt13
-rw-r--r--Tests/Qt4Targets/IncrementalMoc/foo.cpp8
-rw-r--r--Tests/Qt4Targets/IncrementalMoc/foo.h9
3 files changed, 30 insertions, 0 deletions
diff --git a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt
new file mode 100644
index 0000000..4ba0ced
--- /dev/null
+++ b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+cmake_minimum_required(VERSION 2.8.12)
+project(IncrementalMoc)
+
+find_package(Qt4 REQUIRED)
+
+qt4_generate_moc(foo.h moc_foo.cpp)
+
+add_library(testlib foo.cpp moc_foo.cpp)
+target_link_libraries(testlib Qt4::QtCore)
+if (ADD_DEF)
+ target_compile_definitions(testlib PRIVATE NEW_DEF)
+endif()
diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.cpp b/Tests/Qt4Targets/IncrementalMoc/foo.cpp
new file mode 100644
index 0000000..e924f7e
--- /dev/null
+++ b/Tests/Qt4Targets/IncrementalMoc/foo.cpp
@@ -0,0 +1,8 @@
+
+#include "foo.h"
+
+Foo::Foo()
+ : QObject(0)
+{
+
+}
diff --git a/Tests/Qt4Targets/IncrementalMoc/foo.h b/Tests/Qt4Targets/IncrementalMoc/foo.h
new file mode 100644
index 0000000..38d899f
--- /dev/null
+++ b/Tests/Qt4Targets/IncrementalMoc/foo.h
@@ -0,0 +1,9 @@
+
+#include <QObject>
+
+class Foo : QObject
+{
+ Q_OBJECT
+public:
+ Foo();
+};