diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:15 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:15 +0900 |
commit | a9a515dd6b7b96484920a3f0f1202393b91dfd2e (patch) | |
tree | 62e21c47bbffdc30a405d1ef04f452ee46a384b6 /Tests/QtAutogen/RerunMocPlugin/MocPlugin | |
parent | 0375131677cc32a24352f205d05c730690c55af6 (diff) | |
download | cmake-a9a515dd6b7b96484920a3f0f1202393b91dfd2e.tar.gz cmake-a9a515dd6b7b96484920a3f0f1202393b91dfd2e.tar.bz2 cmake-a9a515dd6b7b96484920a3f0f1202393b91dfd2e.zip |
Imported Upstream version 3.11.0upstream/3.11.0
Diffstat (limited to 'Tests/QtAutogen/RerunMocPlugin/MocPlugin')
21 files changed, 179 insertions, 0 deletions
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt new file mode 100644 index 000000000..bc0085fc4 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) +project(MocPlugin) +include("../../AutogenTest.cmake") + +if (NOT QT_TEST_VERSION STREQUAL 5) + message(SEND_ERROR "Invalid Qt version specified.") +endif() + +set(CMAKE_AUTOMOC_DEPEND_FILTERS + "A_CUSTOM_MACRO" + "[\n][ \t]*A_CUSTOM_MACRO[ \t\r\n]*\\([^,]+,[ \t\r\n]*\"([^\"]+)\"" +) + +configure_file(jsonIn/StyleC.json jsonFiles/StyleC.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) + +include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles") +link_libraries(Qt5::Widgets) + +add_library(PlugA STATIC StyleA.cpp) +add_library(PlugB STATIC StyleB.cpp) +add_library(PlugC STATIC StyleC.cpp) +add_library(PlugD STATIC StyleD.cpp) +add_library(PlugE STATIC StyleE.cpp) diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp new file mode 100644 index 000000000..b5e87533c --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp @@ -0,0 +1,6 @@ +#include "StyleA.hpp" + +QStyle* StyleA::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp new file mode 100644 index 000000000..35158a4b0 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp @@ -0,0 +1,17 @@ +#ifndef STYLEA_HPP +#define STYLEA_HPP + +#include "UtilityMacros.hpp" +#include <QStylePlugin> + +class StyleA : public QStylePlugin +{ + Q_OBJECT + // 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: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json new file mode 100644 index 000000000..cc3395369 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json new file mode 100644 index 000000000..cc3395369 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp new file mode 100644 index 000000000..17d440035 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp @@ -0,0 +1,6 @@ +#include "StyleB.hpp" + +QStyle* StyleB::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp new file mode 100644 index 000000000..15b79c598 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp @@ -0,0 +1,17 @@ +#ifndef STYLEB_HPP +#define STYLEB_HPP + +#include "UtilityMacros.hpp" +#include <QStylePlugin> + +class StyleB : public QStylePlugin +{ + Q_OBJECT + // 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: + QStyle* create(const QString& key); +}; + +#endif diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp new file mode 100644 index 000000000..37e756487 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp @@ -0,0 +1,6 @@ +#include "StyleC.hpp" + +QStyle* StyleC::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp new file mode 100644 index 000000000..b0a41150b --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp @@ -0,0 +1,17 @@ +#ifndef STYLEC_HPP +#define STYLEC_HPP + +#include "UtilityMacros.hpp" +#include <QStylePlugin> + +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); +}; + +#endif diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp new file mode 100644 index 000000000..7e4b121fc --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp @@ -0,0 +1,6 @@ +#include "StyleD.hpp" + +QStyle* StyleD::create(const QString& key) +{ + return 0; +} diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp new file mode 100644 index 000000000..9696aaa26 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp @@ -0,0 +1,17 @@ +#ifndef STYLED_HPP +#define STYLED_HPP + +#include "UtilityMacros.hpp" +#include <QStylePlugin> + +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); +}; + +#endif diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp new file mode 100644 index 000000000..344831969 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp @@ -0,0 +1,9 @@ +#include "StyleE.hpp" + +QStyle* StyleE::create(const QString& key) +{ + return 0; +} + +// AUTOMOC the StyleEInclude.hpp header +#include "moc_StyleEInclude.cpp" diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp new file mode 100644 index 000000000..a0690343d --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp @@ -0,0 +1,10 @@ +#ifndef STYLEE_HPP +#define STYLEE_HPP + +// 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/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp new file mode 100644 index 000000000..f9734db4d --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/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/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp new file mode 100644 index 000000000..53a4284ee --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp @@ -0,0 +1,7 @@ +#ifndef UTILITYMACROS_HPP +#define UTILITYMACROS_HPP + +// Empty test macro definition +#define A_CUSTOM_MACRO(name, jsonFile, pluginRegistrations) + +#endif diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json new file mode 100644 index 000000000..cd155dc0e --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json @@ -0,0 +1 @@ +{ "Keys": [ "Red", "Green" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json new file mode 100644 index 000000000..129cac41f --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json @@ -0,0 +1 @@ +{ "Keys": [ "Rocket", "StarbusterB" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json new file mode 100644 index 000000000..119aaa4b7 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json @@ -0,0 +1 @@ +{ "Keys": [ "Boat", "Ship" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json new file mode 100644 index 000000000..732c547ab --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json @@ -0,0 +1 @@ +{ "Keys": [ "Bike", "Car" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json new file mode 100644 index 000000000..5412c94f6 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json @@ -0,0 +1 @@ +{ "Keys": [ "Floor", "Ceiling" ] } diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp new file mode 100644 index 000000000..3ba2ddc6d --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp @@ -0,0 +1,6 @@ +#include "StyleA.hpp" + +int main(int argv, char** args) +{ + return 0; +} |