summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogenRerun/mocPlugin
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-09-03 20:26:09 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-09-21 07:58:24 (GMT)
commite5c6610aba66b0a792f5fedb83e73a43460c3248 (patch)
tree7c5ebc90d12457eb2ba1077ae62446f45e4bc404 /Tests/QtAutogenRerun/mocPlugin
parent932656527bdbf580335a082f8ecbaa888a710901 (diff)
downloadCMake-e5c6610aba66b0a792f5fedb83e73a43460c3248.zip
CMake-e5c6610aba66b0a792f5fedb83e73a43460c3248.tar.gz
CMake-e5c6610aba66b0a792f5fedb83e73a43460c3248.tar.bz2
Autogen: Tests: Extend CMAKE_AUTOMOC_DEPEND_FILTERS rebuild test
The CMAKE_AUTOMOC_DEPEND_FILTERS must also detect filtered file changes from files that are registered to AUTOMOC by a `#include "moc_<NAME>.cpp"` statement.
Diffstat (limited to 'Tests/QtAutogenRerun/mocPlugin')
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt4
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleA.hpp4
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleB.hpp4
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleC.hpp2
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleD.hpp2
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleE.cpp3
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleE.hpp17
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp17
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp)4
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json2
-rw-r--r--Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json1
11 files changed, 38 insertions, 22 deletions
diff --git a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
index 9b224fb..b7cc5e9 100644
--- a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
@@ -16,9 +16,11 @@ if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
endif()
configure_file(jsonIn/StyleC.json jsonFiles/StyleC.json)
-configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD.json)
configure_file(jsonIn/StyleC.json jsonFiles/StyleC_Custom.json)
+configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD.json)
configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD_Custom.json)
+configure_file(jsonIn/StyleE.json jsonFiles/StyleE.json)
+configure_file(jsonIn/StyleE.json jsonFiles/StyleE_Custom.json)
# Enable automoc
set(CMAKE_AUTOMOC TRUE)
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp
index 1b6154d..35158a4 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp
@@ -1,13 +1,13 @@
#ifndef STYLEA_HPP
#define STYLEA_HPP
-#include "StyleCommon.hpp"
+#include "UtilityMacros.hpp"
#include <QStylePlugin>
class StyleA : public QStylePlugin
{
Q_OBJECT
- // Json file in local directory
+ // Json file in source local directory
Q_PLUGIN_METADATA(IID "org.styles.A" FILE "StyleA.json")
A_CUSTOM_MACRO(SomeArg, "StyleA_Custom.json", AnotherArg)
public:
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp
index 163c9b2..15b79c5 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp
@@ -1,13 +1,13 @@
#ifndef STYLEB_HPP
#define STYLEB_HPP
-#include "StyleCommon.hpp"
+#include "UtilityMacros.hpp"
#include <QStylePlugin>
class StyleB : public QStylePlugin
{
Q_OBJECT
- // Json file in local subdirectory
+ // Json file in source local subdirectory
Q_PLUGIN_METADATA(IID "org.styles.B" FILE "jsonIn/StyleB.json")
A_CUSTOM_MACRO(SomeArg, "jsonIn/StyleB_Custom.json", AnotherArg)
public:
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp
index 52a887a..b0a4115 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp
@@ -1,7 +1,7 @@
#ifndef STYLEC_HPP
#define STYLEC_HPP
-#include "StyleCommon.hpp"
+#include "UtilityMacros.hpp"
#include <QStylePlugin>
class StyleC : public QStylePlugin
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp
index df8a439..9696aaa 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp
@@ -1,7 +1,7 @@
#ifndef STYLED_HPP
#define STYLED_HPP
-#include "StyleCommon.hpp"
+#include "UtilityMacros.hpp"
#include <QStylePlugin>
class StyleD : public QStylePlugin
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp
index 8fc9a7f..3448319 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp
@@ -4,3 +4,6 @@ QStyle* StyleE::create(const QString& key)
{
return 0;
}
+
+// AUTOMOC the StyleEInclude.hpp header
+#include "moc_StyleEInclude.cpp"
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp
index e7915a8..a069034 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp
@@ -1,17 +1,10 @@
#ifndef STYLEE_HPP
#define STYLEE_HPP
-#include "StyleCommon.hpp"
-#include <QStylePlugin>
-
-class StyleE : public QStylePlugin
-{
- Q_OBJECT
- // No Json file
- Q_PLUGIN_METADATA(IID "org.styles.E")
- A_CUSTOM_MACRO(SomeArg, InvalidFileArg, AnotherArg)
-public:
- QStyle* create(const QString& key);
-};
+// The included file is not in the sources list and won't be detected by
+// AUTOMOC source file with the same base name.
+// It is registered to AUTOMOCed via a moc_<NAME>.cpp include in StyleE.cpp
+// though.
+#include "StyleEInclude.hpp"
#endif
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp
new file mode 100644
index 0000000..f9734db
--- /dev/null
+++ b/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp
@@ -0,0 +1,17 @@
+#ifndef STYLEE_INCLUDE_HPP
+#define STYLEE_INCLUDE_HPP
+
+#include "UtilityMacros.hpp"
+#include <QStylePlugin>
+
+class StyleE : public QStylePlugin
+{
+ Q_OBJECT
+ // Json files in global root directory
+ Q_PLUGIN_METADATA(IID "org.styles.E" FILE "StyleE.json")
+ A_CUSTOM_MACRO(SomeArg, "StyleE_Custom.json", AnotherArg)
+public:
+ QStyle* create(const QString& key);
+};
+
+#endif
diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp b/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp
index f1a7ec6..53a4284 100644
--- a/Tests/QtAutogenRerun/mocPlugin/StyleCommon.hpp
+++ b/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp
@@ -1,5 +1,5 @@
-#ifndef STYLECOMMON_HPP
-#define STYLECOMMON_HPP
+#ifndef UTILITYMACROS_HPP
+#define UTILITYMACROS_HPP
// Empty test macro definition
#define A_CUSTOM_MACRO(name, jsonFile, pluginRegistrations)
diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json
index 129cac4..cd155dc 100644
--- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json
@@ -1 +1 @@
-{ "Keys": [ "Rocket", "StarbusterB" ] }
+{ "Keys": [ "Red", "Green" ] }
diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json
new file mode 100644
index 0000000..5412c94
--- /dev/null
+++ b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json
@@ -0,0 +1 @@
+{ "Keys": [ "Floor", "Ceiling" ] }