diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-22 20:08:36 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-22 20:15:03 (GMT) |
commit | 94e3f82cf114d12b190d1999a72838018eb171c9 (patch) | |
tree | 2bb559338400ac951533ff3c872e99931e73982e /Tests/QtAutogen/mocPlugin | |
parent | 70ebf35cdaaf391138df7564a07cd205de4af971 (diff) | |
download | CMake-94e3f82cf114d12b190d1999a72838018eb171c9.zip CMake-94e3f82cf114d12b190d1999a72838018eb171c9.tar.gz CMake-94e3f82cf114d12b190d1999a72838018eb171c9.tar.bz2 |
Autogen: Add AUTOMOC_DEPEND_FILTERS test
Diffstat (limited to 'Tests/QtAutogen/mocPlugin')
-rw-r--r-- | Tests/QtAutogen/mocPlugin/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleA.hpp | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleA_Custom.json | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleB.hpp | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleC.hpp | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleCommon.hpp | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleD.hpp | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/StyleE.hpp | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json | 1 |
9 files changed, 28 insertions, 2 deletions
diff --git a/Tests/QtAutogen/mocPlugin/CMakeLists.txt b/Tests/QtAutogen/mocPlugin/CMakeLists.txt index eed7d39..b72b05d 100644 --- a/Tests/QtAutogen/mocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/mocPlugin/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.8) +set(CMAKE_AUTOMOC_DEPEND_FILTERS + "A_CUSTOM_MACRO" + "[\n][ \t]*A_CUSTOM_MACRO[ \t\r\n]*\\([^,]+,[ \t\r\n]*\"([^\"]+)\"" + ) + if (NOT QT_TEST_VERSION STREQUAL 5) message(SEND_ERROR "Invalid Qt version specified.") endif() @@ -9,8 +14,10 @@ if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) endif() -configure_file(jsonIn/StyleC.json jsonFiles/StyleC.json @ONLY) -configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD.json @ONLY) +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_Custom.json) # Enable automoc set(CMAKE_AUTOMOC TRUE) diff --git a/Tests/QtAutogen/mocPlugin/StyleA.hpp b/Tests/QtAutogen/mocPlugin/StyleA.hpp index b105b02..1b6154d 100644 --- a/Tests/QtAutogen/mocPlugin/StyleA.hpp +++ b/Tests/QtAutogen/mocPlugin/StyleA.hpp @@ -1,6 +1,7 @@ #ifndef STYLEA_HPP #define STYLEA_HPP +#include "StyleCommon.hpp" #include <QStylePlugin> class StyleA : public QStylePlugin @@ -8,6 +9,7 @@ class StyleA : public QStylePlugin Q_OBJECT // Json file in local directory Q_PLUGIN_METADATA(IID "org.styles.A" FILE "StyleA.json") + A_CUSTOM_MACRO(SomeArg, "StyleA_Custom.json", AnotherArg) public: QStyle* create(const QString& key); }; diff --git a/Tests/QtAutogen/mocPlugin/StyleA_Custom.json b/Tests/QtAutogen/mocPlugin/StyleA_Custom.json new file mode 100644 index 0000000..cc33953 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleA_Custom.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogen/mocPlugin/StyleB.hpp b/Tests/QtAutogen/mocPlugin/StyleB.hpp index ba89127..163c9b2 100644 --- a/Tests/QtAutogen/mocPlugin/StyleB.hpp +++ b/Tests/QtAutogen/mocPlugin/StyleB.hpp @@ -1,6 +1,7 @@ #ifndef STYLEB_HPP #define STYLEB_HPP +#include "StyleCommon.hpp" #include <QStylePlugin> class StyleB : public QStylePlugin @@ -8,6 +9,7 @@ class StyleB : public QStylePlugin Q_OBJECT // Json file in local subdirectory Q_PLUGIN_METADATA(IID "org.styles.B" FILE "jsonIn/StyleB.json") + A_CUSTOM_MACRO(SomeArg, "jsonIn/StyleB_Custom.json", AnotherArg) public: QStyle* create(const QString& key); }; diff --git a/Tests/QtAutogen/mocPlugin/StyleC.hpp b/Tests/QtAutogen/mocPlugin/StyleC.hpp index 9f71d75..52a887a 100644 --- a/Tests/QtAutogen/mocPlugin/StyleC.hpp +++ b/Tests/QtAutogen/mocPlugin/StyleC.hpp @@ -1,6 +1,7 @@ #ifndef STYLEC_HPP #define STYLEC_HPP +#include "StyleCommon.hpp" #include <QStylePlugin> class StyleC : public QStylePlugin @@ -8,6 +9,7 @@ class StyleC : public QStylePlugin Q_OBJECT // Json file in global root directory Q_PLUGIN_METADATA(IID "org.styles.C" FILE "StyleC.json") + A_CUSTOM_MACRO(SomeArg, "StyleC_Custom.json", AnotherArg) public: QStyle* create(const QString& key); }; diff --git a/Tests/QtAutogen/mocPlugin/StyleCommon.hpp b/Tests/QtAutogen/mocPlugin/StyleCommon.hpp new file mode 100644 index 0000000..f1a7ec6 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/StyleCommon.hpp @@ -0,0 +1,7 @@ +#ifndef STYLECOMMON_HPP +#define STYLECOMMON_HPP + +// Empty test macro definition +#define A_CUSTOM_MACRO(name, jsonFile, pluginRegistrations) + +#endif diff --git a/Tests/QtAutogen/mocPlugin/StyleD.hpp b/Tests/QtAutogen/mocPlugin/StyleD.hpp index e58444d..df8a439 100644 --- a/Tests/QtAutogen/mocPlugin/StyleD.hpp +++ b/Tests/QtAutogen/mocPlugin/StyleD.hpp @@ -1,6 +1,7 @@ #ifndef STYLED_HPP #define STYLED_HPP +#include "StyleCommon.hpp" #include <QStylePlugin> class StyleD : public QStylePlugin @@ -8,6 +9,7 @@ class StyleD : public QStylePlugin Q_OBJECT // Json file in global sub director Q_PLUGIN_METADATA(IID "org.styles.D" FILE "sub/StyleD.json") + A_CUSTOM_MACRO(SomeArg, "sub/StyleD_Custom.json", AnotherArg) public: QStyle* create(const QString& key); }; diff --git a/Tests/QtAutogen/mocPlugin/StyleE.hpp b/Tests/QtAutogen/mocPlugin/StyleE.hpp index 80e0b79..e7915a8 100644 --- a/Tests/QtAutogen/mocPlugin/StyleE.hpp +++ b/Tests/QtAutogen/mocPlugin/StyleE.hpp @@ -1,6 +1,7 @@ #ifndef STYLEE_HPP #define STYLEE_HPP +#include "StyleCommon.hpp" #include <QStylePlugin> class StyleE : public QStylePlugin @@ -8,6 +9,7 @@ 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); }; diff --git a/Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json b/Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json new file mode 100644 index 0000000..129cac4 --- /dev/null +++ b/Tests/QtAutogen/mocPlugin/jsonIn/StyleB_Custom.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "StarbusterB" ] } |