diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-09-25 18:10:26 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-09-28 07:21:44 (GMT) |
commit | 084ace47b6492245c2eb85ced45baccebac8111e (patch) | |
tree | 7c234e9abb973eefed289e517d654a9cbce5f062 /Tests | |
parent | 08041dd15e7a4a030b2458e70018b50e1bbc0939 (diff) | |
download | CMake-084ace47b6492245c2eb85ced45baccebac8111e.zip CMake-084ace47b6492245c2eb85ced45baccebac8111e.tar.gz CMake-084ace47b6492245c2eb85ced45baccebac8111e.tar.bz2 |
Autogen: Tests: Update AUTOMOC_MACRO_NAMES test
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 19 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/CustomMacros.hpp | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Gadget.cpp | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Gadget.hpp | 15 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/MacroAlias.hpp | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/MacroName.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/MacroName.hpp | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object.hpp | 19 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object1Aliased.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object1Aliased.hpp | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object2Aliased.cpp | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/Object2Aliased.hpp | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/main.cpp | 10 |
15 files changed, 139 insertions, 49 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 81ab734..ec35b89 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -66,15 +66,6 @@ set_property(TARGET mocOnly PROPERTY AUTOMOC ON) target_link_libraries(mocOnly ${QT_LIBRARIES}) # -- Test -# MOC AUTOMOC_MACRO_NAMES -if (NOT QT_TEST_VERSION STREQUAL 4) - add_executable(mocMacroName mocMacroName/main.cpp mocMacroName/MacroName.cpp) - set_property(TARGET mocMacroName PROPERTY AUTOMOC ON) - set_property(TARGET mocMacroName PROPERTY AUTOMOC_MACRO_NAMES "QO_ALIAS") - target_link_libraries(mocMacroName ${QT_LIBRARIES}) -endif() - -# -- Test # UIC only if(ALLOW_WRAP_CPP) qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) @@ -188,8 +179,10 @@ set_property(TARGET skipRccB PROPERTY AUTOMOC ON) target_link_libraries(skipRccB ${QT_LIBRARIES}) # -- Test -# Source files with the same basename in different subdirectories -add_subdirectory(sameName) +# MOC AUTOMOC_MACRO_NAMES +if (NOT QT_TEST_VERSION STREQUAL 4) + add_subdirectory(mocMacroName) +endif() # -- Test # Tests AUTOMOC with generated sources @@ -217,5 +210,9 @@ add_subdirectory(uicInclude) add_subdirectory(objectLibrary) # -- Test +# Source files with the same basename in different subdirectories +add_subdirectory(sameName) + +# -- Test # Complex test case add_subdirectory(complex) diff --git a/Tests/QtAutogen/mocMacroName/CMakeLists.txt b/Tests/QtAutogen/mocMacroName/CMakeLists.txt new file mode 100644 index 0000000..08e6803 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.9) + +list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS") + +add_executable(mmn main.cpp Gadget.cpp Object.cpp Object1Aliased.cpp Object2Aliased.cpp) +set_property(TARGET mmn PROPERTY AUTOMOC ON) +set_property(TARGET mmn APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS") +target_link_libraries(mmn ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp b/Tests/QtAutogen/mocMacroName/CustomMacros.hpp new file mode 100644 index 0000000..93e5bfd --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/CustomMacros.hpp @@ -0,0 +1,8 @@ +#ifndef CUSTOM_MACROS_HPP +#define CUSTOM_MACROS_HPP + +#include <QObject> +#define QO1_ALIAS Q_OBJECT +#define QO2_ALIAS Q_OBJECT + +#endif diff --git a/Tests/QtAutogen/mocMacroName/Gadget.cpp b/Tests/QtAutogen/mocMacroName/Gadget.cpp new file mode 100644 index 0000000..167faeb --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Gadget.cpp @@ -0,0 +1,6 @@ +#include "Gadget.hpp" + +Gadget::Gadget() + : test(0) +{ +} diff --git a/Tests/QtAutogen/mocMacroName/Gadget.hpp b/Tests/QtAutogen/mocMacroName/Gadget.hpp new file mode 100644 index 0000000..2587ed2 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Gadget.hpp @@ -0,0 +1,15 @@ +#ifndef GADGET_HPP +#define GADGET_HPP + +#include <QMetaType> + +class Gadget +{ + Q_GADGET + Q_PROPERTY(int test MEMBER test) +public: + Gadget(); + int test; +}; + +#endif diff --git a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp deleted file mode 100644 index cf06f2a..0000000 --- a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MACROALIAS_HPP -#define MACROALIAS_HPP - -#include <QObject> -#define QO_ALIAS Q_OBJECT - -#endif diff --git a/Tests/QtAutogen/mocMacroName/MacroName.cpp b/Tests/QtAutogen/mocMacroName/MacroName.cpp deleted file mode 100644 index 78d04a8..0000000 --- a/Tests/QtAutogen/mocMacroName/MacroName.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "MacroName.hpp" - -MacroName::MacroName() -{ -} - -void MacroName::aSlot() -{ -} diff --git a/Tests/QtAutogen/mocMacroName/MacroName.hpp b/Tests/QtAutogen/mocMacroName/MacroName.hpp deleted file mode 100644 index b6c7306..0000000 --- a/Tests/QtAutogen/mocMacroName/MacroName.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef MACRONAME_HPP -#define MACRONAME_HPP - -#include "MacroAlias.hpp" - -// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES) -class MacroName : public QObject -{ - QO_ALIAS -public: - MacroName(); - -signals: - void aSignal(); - -public slots: - void aSlot(); -}; - -#endif diff --git a/Tests/QtAutogen/mocMacroName/Object.cpp b/Tests/QtAutogen/mocMacroName/Object.cpp new file mode 100644 index 0000000..c0b4f33 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object.cpp @@ -0,0 +1,9 @@ +#include "Object.hpp" + +Object::Object() +{ +} + +void Object::aSlot() +{ +} diff --git a/Tests/QtAutogen/mocMacroName/Object.hpp b/Tests/QtAutogen/mocMacroName/Object.hpp new file mode 100644 index 0000000..0c40824 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object.hpp @@ -0,0 +1,19 @@ +#ifndef OBJECT_HPP +#define OBJECT_HPP + +#include <QObject> + +class Object : public QObject +{ + Q_OBJECT + Q_PROPERTY(int test MEMBER test) +public: + Object(); + + Q_SLOT + void aSlot(); + + int test; +}; + +#endif diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp b/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp new file mode 100644 index 0000000..b8b4806 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp @@ -0,0 +1,9 @@ +#include "Object1Aliased.hpp" + +Object1Aliased::Object1Aliased() +{ +} + +void Object1Aliased::aSlot() +{ +} diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp b/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp new file mode 100644 index 0000000..6c6bb40 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp @@ -0,0 +1,20 @@ +#ifndef OBJECTALIASED_HPP +#define OBJECTALIASED_HPP + +#include "CustomMacros.hpp" + +// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES) +class Object1Aliased : public QObject +{ + QO1_ALIAS +public: + Object1Aliased(); + +signals: + void aSignal(); + +public slots: + void aSlot(); +}; + +#endif diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp b/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp new file mode 100644 index 0000000..4b09dd1 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp @@ -0,0 +1,9 @@ +#include "Object2Aliased.hpp" + +Object2Aliased::Object2Aliased() +{ +} + +void Object2Aliased::aSlot() +{ +} diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp b/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp new file mode 100644 index 0000000..b9bdc12 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp @@ -0,0 +1,20 @@ +#ifndef OBJECT2ALIASED_HPP +#define OBJECT2ALIASED_HPP + +#include "CustomMacros.hpp" + +// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES) +class Object2Aliased : public QObject +{ + QO2_ALIAS +public: + Object2Aliased(); + +signals: + void aSignal(); + +public slots: + void aSlot(); +}; + +#endif diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/mocMacroName/main.cpp index 67ee81f..3b45d04 100644 --- a/Tests/QtAutogen/mocMacroName/main.cpp +++ b/Tests/QtAutogen/mocMacroName/main.cpp @@ -1,7 +1,13 @@ -#include "MacroName.hpp" +#include "Gadget.hpp" +#include "Object.hpp" +#include "Object1Aliased.hpp" +#include "Object2Aliased.hpp" int main(int argv, char** args) { - MacroName macroName; + Gadget gadget; + Object object; + Object1Aliased object1Aliased; + Object2Aliased object2Aliased; return 0; } |