diff options
author | Brad King <brad.king@kitware.com> | 2018-01-22 15:23:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-22 15:23:41 (GMT) |
commit | b058d92b33ab37a56ac4dcf2f1e49aec89f554e3 (patch) | |
tree | 6b81a116a57d7f8fcc6c023a4f3107a7c4634ca3 /Tests/QtAutogen/MocOnly | |
parent | 5d13fa1010223a65e64f5270db06ada9c6a0ae0d (diff) | |
parent | b4e6911bf51c05001c1b3cbcc04587afa6ba4577 (diff) | |
download | CMake-b058d92b33ab37a56ac4dcf2f1e49aec89f554e3.zip CMake-b058d92b33ab37a56ac4dcf2f1e49aec89f554e3.tar.gz CMake-b058d92b33ab37a56ac4dcf2f1e49aec89f554e3.tar.bz2 |
Merge topic 'autogen-first-line-fix'
b4e6911b Autogen: Tests: Extend AUTOUIC include patterns test
ff91a5d5 Autogen: Tests: Extend AUTOMOC include patterns test
a1d491ca Autogen: AUTOMOC/UIC fix for moc/uic include on the first line
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1670
Diffstat (limited to 'Tests/QtAutogen/MocOnly')
-rw-r--r-- | Tests/QtAutogen/MocOnly/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/IncA.cpp | 19 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/IncA.hpp | 15 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/IncB.cpp | 19 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/IncB.hpp | 15 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/main.cpp | 5 |
6 files changed, 82 insertions, 2 deletions
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt index 33feadf..a37a2ae 100644 --- a/Tests/QtAutogen/MocOnly/CMakeLists.txt +++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt @@ -2,7 +2,14 @@ cmake_minimum_required(VERSION 3.10) project(MocOnly) include("../AutogenTest.cmake") -# Test different Q_OBJECT position styles -add_executable(mocOnly StyleA.cpp StyleB.cpp main.cpp) +add_executable(mocOnly + main.cpp + # Test different Q_OBJECT position styles + StyleA.cpp + StyleB.cpp + # Test different moc_/.moc include positions + IncA.cpp + IncB.cpp +) set_property(TARGET mocOnly PROPERTY AUTOMOC ON) target_link_libraries(mocOnly ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/MocOnly/IncA.cpp b/Tests/QtAutogen/MocOnly/IncA.cpp new file mode 100644 index 0000000..94610cd --- /dev/null +++ b/Tests/QtAutogen/MocOnly/IncA.cpp @@ -0,0 +1,19 @@ +#include "moc_IncA.cpp" +/// AUTOMOC moc_ include on the first line of the file! +#include "IncA.hpp" + +/// @brief Source local QObject +/// +class IncAPrivate : public QObject +{ + Q_OBJECT +public: + IncAPrivate(){}; +}; + +IncA::IncA() +{ + IncAPrivate priv; +} + +#include "IncA.moc" diff --git a/Tests/QtAutogen/MocOnly/IncA.hpp b/Tests/QtAutogen/MocOnly/IncA.hpp new file mode 100644 index 0000000..ecc889f --- /dev/null +++ b/Tests/QtAutogen/MocOnly/IncA.hpp @@ -0,0 +1,15 @@ +#ifndef INCA_HPP +#define INCA_HPP + +#include <QObject> + +/// @brief Test moc include pattern in the source file +/// +class IncA : public QObject +{ + Q_OBJECT +public: + IncA(); +}; + +#endif diff --git a/Tests/QtAutogen/MocOnly/IncB.cpp b/Tests/QtAutogen/MocOnly/IncB.cpp new file mode 100644 index 0000000..bd441a9 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/IncB.cpp @@ -0,0 +1,19 @@ +#include "IncB.hpp" + +/// @brief Source local QObject +/// +class IncBPrivate : public QObject +{ + Q_OBJECT +public: + IncBPrivate(){}; +}; + +IncB::IncB() +{ + IncBPrivate priv; +} + +/// AUTOMOC moc_ include on the last line of the file! +#include "IncB.moc" +#include "moc_IncB.cpp" diff --git a/Tests/QtAutogen/MocOnly/IncB.hpp b/Tests/QtAutogen/MocOnly/IncB.hpp new file mode 100644 index 0000000..8331ea2 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/IncB.hpp @@ -0,0 +1,15 @@ +#ifndef INCB_HPP +#define INCB_HPP + +#include <QObject> + +/// @brief Test moc include pattern in the source file +/// +class IncB : public QObject +{ + Q_OBJECT +public: + IncB(); +}; + +#endif diff --git a/Tests/QtAutogen/MocOnly/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp index 06f8d81..1611f97 100644 --- a/Tests/QtAutogen/MocOnly/main.cpp +++ b/Tests/QtAutogen/MocOnly/main.cpp @@ -1,3 +1,5 @@ +#include "IncA.hpp" +#include "IncB.hpp" #include "StyleA.hpp" #include "StyleB.hpp" @@ -5,5 +7,8 @@ int main(int argv, char** args) { StyleA styleA; StyleB styleB; + IncA incA; + IncB incB; + return 0; } |