From 102d8d48db92438eff0d59a7907bc18d42673ec5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 7 Sep 2020 09:50:15 +0200 Subject: CMake build: Make Qt6::Core5Compat available in a portable way While porting to Qt6 we'll need the compat library at some places. Add a custom Qt6Core5Compat target that we can unconditionally use. For Qt5 it refers to a dummy target. For Qt6 it refers to the actual compat library. Task-number: QTCREATORBUG-24098 Change-Id: Idd2b9f285352f685cfe715eee3fa046dfb468873 Reviewed-by: Cristian Adam --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1282fe6206..753b98c09e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,10 +42,13 @@ endif() find_package(Qt5 ${IDE_QT_VERSION_MIN} COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick - QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT} + QuickWidgets Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT} REQUIRED ) -find_package(Qt5 COMPONENTS LinguistTools) +if (Qt5_VERSION VERSION_LESS 6.0.0) + install(TARGETS Qt6Core5Compat EXPORT QtCreator) +endif() +find_package(Qt5 COMPONENTS LinguistTools QUIET) find_package(Qt5 COMPONENTS Designer DesignerComponents Help SerialPort Svg QUIET) find_package(Threads) -- cgit v1.2.3