diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-07-09 10:45:07 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-07-20 14:55:11 (GMT) |
commit | f5ccef17515ed4794659923706989fa059b4df38 (patch) | |
tree | a89fb812c1806f77ffa12621cb055694ac8a79dc /Tests/QtAutogen/mocIncludeRelaxed | |
parent | a8d8d2fd05e65444e52adb5164a38f3c64b247d5 (diff) | |
download | CMake-f5ccef17515ed4794659923706989fa059b4df38.zip CMake-f5ccef17515ed4794659923706989fa059b4df38.tar.gz CMake-f5ccef17515ed4794659923706989fa059b4df38.tar.bz2 |
Autogen: Extended mocInclude tests
The extended tests cover more AUTOMOC use cases.
Diffstat (limited to 'Tests/QtAutogen/mocIncludeRelaxed')
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt | 23 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp | 12 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp | 12 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp | 14 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp | 22 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp | 14 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp | 14 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp | 30 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp | 14 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeRelaxed/main.cpp | 18 |
10 files changed, 158 insertions, 15 deletions
diff --git a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt index 6a0829d..97ba1df 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt +++ b/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt @@ -2,17 +2,16 @@ set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) -include_directories("../mocInclude") +# Shared executable +set(MOC_INCLUDE_NAME "mocIncludeRelaxed") +include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake) -add_executable(mocIncludeRelaxed - ../mocInclude/ObjA.cpp - ../mocInclude/ObjB.cpp - ../mocInclude/ObjC.cpp - ../mocInclude/ObjD.cpp - ../mocInclude/subA/SubObjA.cpp - ../mocInclude/subB/SubObjB.cpp - ../mocInclude/subC/SubObjC.cpp - main.cpp +# Relaxed ony executable +add_executable(mocIncludeRelaxedOnly + RObjA.cpp + RObjB.cpp + RObjC.cpp + RMain.cpp ) -target_link_libraries(mocIncludeRelaxed ${QT_LIBRARIES}) -set_target_properties(mocIncludeRelaxed PROPERTIES AUTOMOC ON) +target_link_libraries(mocIncludeRelaxedOnly ${QT_LIBRARIES}) +set_target_properties(mocIncludeRelaxedOnly PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp new file mode 100644 index 0000000..5b2c070 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp @@ -0,0 +1,12 @@ +// Relaxed AUTOMOC objects +#include "RObjA.hpp" +#include "RObjB.hpp" +#include "RObjC.hpp" + +int main(int argv, char** args) +{ + RObjA rObjA; + RObjB rObjB; + RObjC rObjC; + return 0; +} diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp new file mode 100644 index 0000000..2e2cf6a --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp @@ -0,0 +1,12 @@ +#include "RObjA.hpp" + +RObjA::RObjA() +{ +} + +RObjA::~RObjA() +{ +} + +// Relaxed include should moc the header instead +#include "RObjA.moc" diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp new file mode 100644 index 0000000..5974187 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp @@ -0,0 +1,14 @@ +#ifndef ROBJA_HPP +#define ROBJA_HPP + +#include <QObject> + +class RObjA : public QObject +{ + Q_OBJECT +public: + RObjA(); + ~RObjA(); +}; + +#endif diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp new file mode 100644 index 0000000..c56d10f --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp @@ -0,0 +1,22 @@ +#include "RObjB.hpp" +#include "RObjBExtra.hpp" + +RObjBExtra::RObjBExtra() +{ +} + +RObjBExtra::~RObjBExtra() +{ +} + +RObjB::RObjB() +{ + RObjBExtra extraObject; +} + +RObjB::~RObjB() +{ +} + +// Relaxed mode should run moc on RObjBExtra.hpp instead +#include "RObjBExtra.moc" diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp new file mode 100644 index 0000000..d6d0474 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp @@ -0,0 +1,14 @@ +#ifndef ROBJB_HPP +#define ROBJB_HPP + +#include <QObject> + +class RObjB : public QObject +{ + Q_OBJECT +public: + RObjB(); + ~RObjB(); +}; + +#endif diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp new file mode 100644 index 0000000..5d6be75 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp @@ -0,0 +1,14 @@ +#ifndef ROBJBEXTRA_HPP +#define ROBJBEXTRA_HPP + +#include <QObject> + +class RObjBExtra : public QObject +{ + Q_OBJECT +public: + RObjBExtra(); + ~RObjBExtra(); +}; + +#endif diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp new file mode 100644 index 0000000..4ba32f5 --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp @@ -0,0 +1,30 @@ +#include "RObjC.hpp" +#include <QObject> + +class RObjCPrivate : public QObject +{ + Q_OBJECT +public: + RObjCPrivate(); + ~RObjCPrivate(); +}; + +RObjCPrivate::RObjCPrivate() +{ +} + +RObjCPrivate::~RObjCPrivate() +{ +} + +RObjC::RObjC() +{ + RObjCPrivate privateObject; +} + +RObjC::~RObjC() +{ +} + +// Relaxed include should moc this source instead of the header +#include "moc_RObjC.cpp" diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp new file mode 100644 index 0000000..5552ede --- /dev/null +++ b/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp @@ -0,0 +1,14 @@ +#ifndef ROBJC_HPP +#define ROBJC_HPP + +#include <QObject> + +class RObjC : public QObject +{ + Q_OBJECT +public: + RObjC(); + ~RObjC(); +}; + +#endif diff --git a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp index 142d59e..5a3148d 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp +++ b/Tests/QtAutogen/mocIncludeRelaxed/main.cpp @@ -1,14 +1,26 @@ +#include "EObjA.hpp" +#include "EObjB.hpp" +#include "LObjA.hpp" +#include "LObjB.hpp" #include "ObjA.hpp" #include "ObjB.hpp" -#include "ObjC.hpp" +#include "SObjA.hpp" +#include "SObjB.hpp" +#include "subGlobal/GObj.hpp" int main(int argv, char** args) { + subGlobal::GObj gObj; ObjA objA; ObjB objB; - ObjC objC; + LObjA lObjA; + LObjB lObjB; + EObjA eObjA; + EObjB eObjB; + SObjA sObjA; + SObjB sObjB; return 0; } // Header in global subdirectory -#include "subB/moc_SubObjB.cpp" +#include "subGlobal/moc_GObj.cpp" |