mirror of
https://github.com/reactos/CMake.git
synced 2024-12-03 00:57:25 +00:00
Autogen: Tests: Extend AUTOMOC include patterns test
This commit is contained in:
parent
a1d491ca27
commit
ff91a5d54b
@ -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})
|
||||
|
19
Tests/QtAutogen/MocOnly/IncA.cpp
Normal file
19
Tests/QtAutogen/MocOnly/IncA.cpp
Normal file
@ -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"
|
15
Tests/QtAutogen/MocOnly/IncA.hpp
Normal file
15
Tests/QtAutogen/MocOnly/IncA.hpp
Normal file
@ -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
|
19
Tests/QtAutogen/MocOnly/IncB.cpp
Normal file
19
Tests/QtAutogen/MocOnly/IncB.cpp
Normal file
@ -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"
|
15
Tests/QtAutogen/MocOnly/IncB.hpp
Normal file
15
Tests/QtAutogen/MocOnly/IncB.hpp
Normal file
@ -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
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user