diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-12-08 17:24:52 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-12-13 12:48:28 (GMT) |
commit | 0af9da29e487f0a6c60c379f0773a68b40ce2625 (patch) | |
tree | 1183f13f668dca872829610a02fdde54c6f65803 /Tests/QtAutogen | |
parent | f658bdaa7c7899a46caf402d4114999019897d46 (diff) | |
download | CMake-0af9da29e487f0a6c60c379f0773a68b40ce2625.zip CMake-0af9da29e487f0a6c60c379f0773a68b40ce2625.tar.gz CMake-0af9da29e487f0a6c60c379f0773a68b40ce2625.tar.bz2 |
Autogen: Tests: Separate MocSkipSource test
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 35 | ||||
-rw-r--r-- | Tests/QtAutogen/CommonTests.cmake | 3 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/CMakeLists.txt | 36 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemA.cpp (renamed from Tests/QtAutogen/skipSource/qItemA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemA.hpp (renamed from Tests/QtAutogen/skipSource/qItemA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemB.cpp (renamed from Tests/QtAutogen/skipSource/qItemB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemB.hpp (renamed from Tests/QtAutogen/skipSource/qItemB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemC.cpp (renamed from Tests/QtAutogen/skipSource/qItemC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemC.hpp (renamed from Tests/QtAutogen/skipSource/qItemC.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemD.cpp (renamed from Tests/QtAutogen/skipSource/qItemD.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemD.hpp (renamed from Tests/QtAutogen/skipSource/qItemD.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/skipMoc.cpp (renamed from Tests/QtAutogen/skipMoc.cpp) | 8 |
12 files changed, 43 insertions, 39 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 723747a..d09823f 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -60,41 +60,6 @@ if(NON_ASCII_BDIR AND WIN32) endif() # -- Test -# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target -if(ALLOW_WRAP_CPP) - # Generate header mocs manually - qtx_wrap_cpp(skipMocWrapMoc - skipSource/qItemA.hpp - skipSource/qItemB.hpp - skipSource/qItemC.hpp - skipSource/qItemD.hpp - ) - set(skipMocSources - skipMoc.cpp - skipSource/qItemA.cpp - skipSource/qItemB.cpp - skipSource/qItemC.cpp - skipSource/qItemD.cpp - ) - # When cpp files are skipped, the hpp won't be processed either, - # unless they are mentioned in the sources - which they aren't. - set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON) - set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON) - # When hpp files are skipped, the cpp still get processed. - set_property(SOURCE skipSource/qItemC.hpp PROPERTY SKIP_AUTOMOC ON) - set_property(SOURCE skipSource/qItemD.hpp PROPERTY SKIP_AUTOGEN ON) - # AUTOMOC enabled only - add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) - set_property(TARGET skipMocA PROPERTY AUTOMOC ON) - target_link_libraries(skipMocA ${QT_LIBRARIES}) - # AUTOMOC and AUTOUIC enabled - add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) - set_property(TARGET skipMocB PROPERTY AUTOMOC ON) - set_property(TARGET skipMocB PROPERTY AUTOUIC ON) - target_link_libraries(skipMocB ${QT_LIBRARIES}) -endif() - -# -- Test # Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target set(skipUicSources skipUic.cpp diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index f998b74..072a853 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -7,3 +7,6 @@ endif() ADD_AUTOGEN_TEST(RccOnly rccOnly) ADD_AUTOGEN_TEST(RccEmpty rccEmpty) ADD_AUTOGEN_TEST(RccOffMocLibrary) +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(MocSkipSource) +endif() diff --git a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt new file mode 100644 index 0000000..8d1fa6a --- /dev/null +++ b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.10) +project(MocSkipSource) +include("../AutogenTest.cmake") + +# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target + +# Generate header mocs manually +qtx_wrap_cpp(skipMocWrapMoc + qItemA.hpp + qItemB.hpp + qItemC.hpp + qItemD.hpp +) +set(skipMocSources + skipMoc.cpp + qItemA.cpp + qItemB.cpp + qItemC.cpp + qItemD.cpp +) +# When cpp files are skipped, the hpp won't be processed either, +# unless they are mentioned in the sources - which they aren't. +set_property(SOURCE qItemA.cpp PROPERTY SKIP_AUTOMOC ON) +set_property(SOURCE qItemB.cpp PROPERTY SKIP_AUTOGEN ON) +# When hpp files are skipped, the cpp still get processed. +set_property(SOURCE qItemC.hpp PROPERTY SKIP_AUTOMOC ON) +set_property(SOURCE qItemD.hpp PROPERTY SKIP_AUTOGEN ON) +# AUTOMOC enabled only +add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) +set_property(TARGET skipMocA PROPERTY AUTOMOC ON) +target_link_libraries(skipMocA ${QT_LIBRARIES}) +# AUTOMOC and AUTOUIC enabled +add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) +set_property(TARGET skipMocB PROPERTY AUTOMOC ON) +set_property(TARGET skipMocB PROPERTY AUTOUIC ON) +target_link_libraries(skipMocB ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/skipSource/qItemA.cpp b/Tests/QtAutogen/MocSkipSource/qItemA.cpp index 522c2c7..522c2c7 100644 --- a/Tests/QtAutogen/skipSource/qItemA.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemA.cpp diff --git a/Tests/QtAutogen/skipSource/qItemA.hpp b/Tests/QtAutogen/MocSkipSource/qItemA.hpp index d295faf..d295faf 100644 --- a/Tests/QtAutogen/skipSource/qItemA.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemA.hpp diff --git a/Tests/QtAutogen/skipSource/qItemB.cpp b/Tests/QtAutogen/MocSkipSource/qItemB.cpp index 636e15d..636e15d 100644 --- a/Tests/QtAutogen/skipSource/qItemB.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemB.cpp diff --git a/Tests/QtAutogen/skipSource/qItemB.hpp b/Tests/QtAutogen/MocSkipSource/qItemB.hpp index 1775915..1775915 100644 --- a/Tests/QtAutogen/skipSource/qItemB.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemB.hpp diff --git a/Tests/QtAutogen/skipSource/qItemC.cpp b/Tests/QtAutogen/MocSkipSource/qItemC.cpp index 622f282..622f282 100644 --- a/Tests/QtAutogen/skipSource/qItemC.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemC.cpp diff --git a/Tests/QtAutogen/skipSource/qItemC.hpp b/Tests/QtAutogen/MocSkipSource/qItemC.hpp index f06bda2..f06bda2 100644 --- a/Tests/QtAutogen/skipSource/qItemC.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemC.hpp diff --git a/Tests/QtAutogen/skipSource/qItemD.cpp b/Tests/QtAutogen/MocSkipSource/qItemD.cpp index fe0f4e4..fe0f4e4 100644 --- a/Tests/QtAutogen/skipSource/qItemD.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemD.cpp diff --git a/Tests/QtAutogen/skipSource/qItemD.hpp b/Tests/QtAutogen/MocSkipSource/qItemD.hpp index 99e0acb..99e0acb 100644 --- a/Tests/QtAutogen/skipSource/qItemD.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemD.hpp diff --git a/Tests/QtAutogen/skipMoc.cpp b/Tests/QtAutogen/MocSkipSource/skipMoc.cpp index d6b292f..c915334 100644 --- a/Tests/QtAutogen/skipMoc.cpp +++ b/Tests/QtAutogen/MocSkipSource/skipMoc.cpp @@ -1,8 +1,8 @@ -#include "skipSource/qItemA.hpp" -#include "skipSource/qItemB.hpp" -#include "skipSource/qItemC.hpp" -#include "skipSource/qItemD.hpp" +#include "qItemA.hpp" +#include "qItemB.hpp" +#include "qItemC.hpp" +#include "qItemD.hpp" int main(int, char**) { |