diff options
author | Brad King <brad.king@kitware.com> | 2017-12-14 13:21:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-12-14 13:21:28 (GMT) |
commit | 7341930ade835ce48641b5415cdd3f738772edf2 (patch) | |
tree | 377585f108b61dbc8b28462f708360a6ac504205 /Tests/QtAutogen/DefinesTest | |
parent | 671958d2884e2d2597362265620b73f43d414870 (diff) | |
parent | 540d08f4858ddbb8d0356f77f878b9fbb7af8f80 (diff) | |
download | CMake-7341930ade835ce48641b5415cdd3f738772edf2.zip CMake-7341930ade835ce48641b5415cdd3f738772edf2.tar.gz CMake-7341930ade835ce48641b5415cdd3f738772edf2.tar.bz2 |
Merge topic 'autogen-separate-tests'
540d08f4 Autogen: Tests: Move QtAutoUicInterface test to QtAutogen/UicInterface
b1504f9f Autogen: Tests: Separate RerunRccDepends test
e9fcd154 Autogen: Tests: Separate RerunMocPlugin test
54b4ff2a Autogen: Tests: Separate RerunMocBasic test
4988746e Autogen: Tests: Separate Complex test
6ce6fd42 Autogen: Tests: Separate StaticLibraryCycle test
45b6776a Autogen: Tests: Separate SameName test
d7868687 Autogen: Tests: Separate MacOsFW test
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1578
Diffstat (limited to 'Tests/QtAutogen/DefinesTest')
-rw-r--r-- | Tests/QtAutogen/DefinesTest/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/QtAutogen/DefinesTest/defines_test.cpp | 38 |
2 files changed, 51 insertions, 0 deletions
diff --git a/Tests/QtAutogen/DefinesTest/CMakeLists.txt b/Tests/QtAutogen/DefinesTest/CMakeLists.txt new file mode 100644 index 0000000..de22845 --- /dev/null +++ b/Tests/QtAutogen/DefinesTest/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) +project(DefinesTest) + +# Qt4 only definitions test +if(NOT QT_TEST_VERSION STREQUAL 4) + message(ERROR "Invalid Qt test version. This test is for Qt4 only.") +endif() + +find_package(Qt4 REQUIRED) + +add_executable(DefinesTest defines_test.cpp) +set_target_properties(DefinesTest PROPERTIES AUTOMOC TRUE) +target_link_libraries(DefinesTest Qt4::QtGui) diff --git a/Tests/QtAutogen/DefinesTest/defines_test.cpp b/Tests/QtAutogen/DefinesTest/defines_test.cpp new file mode 100644 index 0000000..cf4e9cb --- /dev/null +++ b/Tests/QtAutogen/DefinesTest/defines_test.cpp @@ -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" |