mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
Autogen: Add test for AUTOMOC_MACRO_NAMES
This commit is contained in:
@@ -65,6 +65,15 @@ add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySo
|
||||
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)
|
||||
|
||||
7
Tests/QtAutogen/mocMacroName/MacroAlias.hpp
Normal file
7
Tests/QtAutogen/mocMacroName/MacroAlias.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef MACROALIAS_HPP
|
||||
#define MACROALIAS_HPP
|
||||
|
||||
#include <QObject>
|
||||
#define QO_ALIAS Q_OBJECT
|
||||
|
||||
#endif
|
||||
9
Tests/QtAutogen/mocMacroName/MacroName.cpp
Normal file
9
Tests/QtAutogen/mocMacroName/MacroName.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "MacroName.hpp"
|
||||
|
||||
MacroName::MacroName()
|
||||
{
|
||||
}
|
||||
|
||||
void MacroName::aSlot()
|
||||
{
|
||||
}
|
||||
20
Tests/QtAutogen/mocMacroName/MacroName.hpp
Normal file
20
Tests/QtAutogen/mocMacroName/MacroName.hpp
Normal file
@@ -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
|
||||
7
Tests/QtAutogen/mocMacroName/main.cpp
Normal file
7
Tests/QtAutogen/mocMacroName/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "MacroName.hpp"
|
||||
|
||||
int main(int argv, char** args)
|
||||
{
|
||||
MacroName macroName;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user