mirror of
https://github.com/reactos/CMake.git
synced 2025-02-02 01:55:03 +00:00
Autogen: Tests: Separate MocMacroName test
This commit is contained in:
parent
5cab8c307c
commit
fb7e52ca3d
@ -59,12 +59,6 @@ if(NON_ASCII_BDIR AND WIN32)
|
||||
set(ALLOW_WRAP_CPP FALSE)
|
||||
endif()
|
||||
|
||||
# -- Test
|
||||
# MOC AUTOMOC_MACRO_NAMES
|
||||
if (NOT QT_TEST_VERSION STREQUAL 4)
|
||||
add_subdirectory(mocMacroName)
|
||||
endif()
|
||||
|
||||
# -- Test
|
||||
# Tests AUTOMOC with generated sources
|
||||
add_subdirectory(mocDepends)
|
||||
|
@ -12,3 +12,6 @@ if(QT_TEST_ALLOW_QT_MACROS)
|
||||
endif()
|
||||
ADD_AUTOGEN_TEST(UicSkipSource)
|
||||
ADD_AUTOGEN_TEST(RccSkipSource)
|
||||
if(NOT QT_TEST_VERSION STREQUAL 4)
|
||||
ADD_AUTOGEN_TEST(MocMacroName mocMacroName)
|
||||
endif()
|
||||
|
17
Tests/QtAutogen/MocMacroName/CMakeLists.txt
Normal file
17
Tests/QtAutogen/MocMacroName/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(MocMacroName)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test CMAKE_AUTOMOC_MACRO_NAMES and AUTOMOC_MACRO_NAMES
|
||||
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS")
|
||||
|
||||
add_executable(mocMacroName
|
||||
main.cpp
|
||||
Gadget.cpp
|
||||
Object.cpp
|
||||
Object1Aliased.cpp
|
||||
Object2Aliased.cpp
|
||||
)
|
||||
set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
|
||||
set_property(TARGET mocMacroName APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS")
|
||||
target_link_libraries(mocMacroName ${QT_LIBRARIES})
|
@ -1,6 +1,6 @@
|
||||
#include "Gadget.hpp"
|
||||
|
||||
Gadget::Gadget()
|
||||
: test(0)
|
||||
: _test(0)
|
||||
{
|
||||
}
|
@ -6,10 +6,14 @@
|
||||
class Gadget
|
||||
{
|
||||
Q_GADGET
|
||||
Q_PROPERTY(int test MEMBER test)
|
||||
Q_PROPERTY(int test READ getTest)
|
||||
public:
|
||||
Gadget();
|
||||
int test;
|
||||
|
||||
int getTest() { return _test; }
|
||||
|
||||
private:
|
||||
int _test;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,6 +1,7 @@
|
||||
#include "Object.hpp"
|
||||
|
||||
Object::Object()
|
||||
: _test(0)
|
||||
{
|
||||
}
|
||||
|
@ -6,14 +6,17 @@
|
||||
class Object : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int test MEMBER test)
|
||||
Q_PROPERTY(int test READ getTest)
|
||||
public:
|
||||
Object();
|
||||
|
||||
int getTest() { return _test; }
|
||||
|
||||
Q_SLOT
|
||||
void aSlot();
|
||||
|
||||
int test;
|
||||
private:
|
||||
int _test;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,8 +0,0 @@
|
||||
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})
|
Loading…
x
Reference in New Issue
Block a user