mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 04:29:52 +00:00
Merge topic 'test-moc-with-empty-COMPILE_DEFINITIONS'
5c0f2a1
Test the use of target transitive compile definitions with moc.
This commit is contained in:
commit
1a2a0dadda
@ -5,6 +5,9 @@ project(QtAutomoc)
|
||||
if (QT_TEST_VERSION STREQUAL 4)
|
||||
find_package(Qt4 REQUIRED)
|
||||
|
||||
# Include this directory before using the UseQt4 file.
|
||||
add_subdirectory(defines_test)
|
||||
|
||||
include(UseQt4)
|
||||
|
||||
set(QT_QTCORE_TARGET Qt4::QtCore)
|
||||
|
6
Tests/QtAutomoc/defines_test/CMakeLists.txt
Normal file
6
Tests/QtAutomoc/defines_test/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_executable(defines_test defines_test.cpp)
|
||||
set_target_properties(defines_test PROPERTIES AUTOMOC TRUE)
|
||||
target_link_libraries(defines_test Qt4::QtGui)
|
38
Tests/QtAutomoc/defines_test/defines_test.cpp
Normal file
38
Tests/QtAutomoc/defines_test/defines_test.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#ifdef QT_GUI_LIB
|
||||
#include <QTextDocument>
|
||||
|
||||
class SomeDocument : public QTextDocument
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_SIGNALS:
|
||||
void someSig();
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef QT_CORE_LIB
|
||||
class SomeObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_SIGNALS:
|
||||
void someSig();
|
||||
};
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef QT_CORE_LIB
|
||||
QMetaObject sosmo = SomeObject::staticMetaObject;
|
||||
#endif
|
||||
#ifdef QT_GUI_LIB
|
||||
QMetaObject sdsmo = SomeDocument::staticMetaObject;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "defines_test.moc"
|
Loading…
Reference in New Issue
Block a user