diff options
author | Cristian Adam <cristian.adam@qt.io> | 2019-09-23 17:58:34 +0200 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2019-09-24 16:05:23 +0000 |
commit | f88ad0e9d04aac2ef66367e1f661d15644cbf8a4 (patch) | |
tree | bb5b2d24a82198040c3d456ccf363148e381e565 /CMakeLists.txt | |
parent | 4ea0d22d4c3536ac5fc3367c56502a61f1d4fc90 (diff) |
CMake Build: Allow building with Qt5 and Qt6
Emulate Qt5's functions/targets with Qt6 equivalents.
Change-Id: I6bfc5c8a649f0ddc5f1117bc5b2d0f41cb72c821
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c047ca59d5..c7e86cd6d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,13 +30,17 @@ set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) if (WITH_TESTS) - set(_TEST_QT_COMPONENT Test) - set(_TEST_DEPENDS Qt5::Test) + set(QT_TEST_COMPONENT Test) + set(IMPLICIT_DEPENDS Qt5::Test) +endif() + +if (BUILD_WITH_PCH) + list(APPEND IMPLICIT_DEPENDS Qt5::Core) endif() find_package(Qt5 - COMPONENTS Concurrent Core LinguistTools Network PrintSupport Qml Quick - QuickWidgets Sql Widgets ${_TEST_QT_COMPONENT} + COMPONENTS Concurrent Core Gui LinguistTools Network PrintSupport Qml Quick + QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT} REQUIRED ) |