diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-08-18 10:29:50 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-08-18 10:32:34 (GMT) |
commit | 05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2 (patch) | |
tree | a4926a4946f51987dd15b6e30d50520c2839e75e /Tests/QtAutogen | |
parent | 93f0ba2823b694340e6cfdb4e6befbf7fcf520bd (diff) | |
download | CMake-05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2.zip CMake-05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2.tar.gz CMake-05891d8f774cc2ac3fea44f6f320dcdc2e1d95e2.tar.bz2 |
Autogen: Add test for AUTOMOC_MACRO_NAMES
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 9 | ||||
-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/main.cpp | 7 |
5 files changed, 52 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 198bf63..be864c3 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -66,6 +66,15 @@ 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) diff --git a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp new file mode 100644 index 0000000..cf06f2a --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp @@ -0,0 +1,7 @@ +#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 new file mode 100644 index 0000000..78d04a8 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/MacroName.cpp @@ -0,0 +1,9 @@ +#include "MacroName.hpp" + +MacroName::MacroName() +{ +} + +void MacroName::aSlot() +{ +} diff --git a/Tests/QtAutogen/mocMacroName/MacroName.hpp b/Tests/QtAutogen/mocMacroName/MacroName.hpp new file mode 100644 index 0000000..b6c7306 --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/MacroName.hpp @@ -0,0 +1,20 @@ +#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/main.cpp b/Tests/QtAutogen/mocMacroName/main.cpp new file mode 100644 index 0000000..67ee81f --- /dev/null +++ b/Tests/QtAutogen/mocMacroName/main.cpp @@ -0,0 +1,7 @@ +#include "MacroName.hpp" + +int main(int argv, char** args) +{ + MacroName macroName; + return 0; +} |