From 885abf6147bf2260dc21d9b8e1752d6f39b315ca Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 9 Dec 2020 17:26:14 +0100 Subject: Fix build of some examples on Windows ba2da7d7459a4c64379336435d6091b30ac0d71e fixed the build of some examples when cross-compiling, but for whatever reason it breaks regular builds on Windows. This patch makes that fix more specific in the environments it affects. Fixes: QTBUG-89290 Pick-to: 6.0 Change-Id: I5356a855e3b6f9c27ba05beb9dc11dc32920c6c5 Reviewed-by: Alexandru Croitor --- examples/quickcontrols2/gallery/CMakeLists.txt | 10 ++++++---- examples/quickcontrols2/wearable/CMakeLists.txt | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/quickcontrols2/gallery/CMakeLists.txt b/examples/quickcontrols2/gallery/CMakeLists.txt index ecb308c7..e960f6cc 100644 --- a/examples/quickcontrols2/gallery/CMakeLists.txt +++ b/examples/quickcontrols2/gallery/CMakeLists.txt @@ -32,12 +32,14 @@ target_link_libraries(gallery_controls2 PUBLIC # special case Qt::Gui Qt::Quick Qt::QuickControls2 +) # special case begin - # Work around QTBUG-86533 - Qt::QuickTemplates2 +if(UNIX AND NOT APPLE AND CMAKE_CROSSCOMPILING) + find_package(Qt6 COMPONENTS QuickTemplates2) + # Work around QTBUG-86533 + target_link_libraries(gallery_controls2 PRIVATE Qt::QuickTemplates2) +endif() # special case end -) - # Resources: set(qmake_immediate_resource_files diff --git a/examples/quickcontrols2/wearable/CMakeLists.txt b/examples/quickcontrols2/wearable/CMakeLists.txt index cb5e833c..1b9ad7ff 100644 --- a/examples/quickcontrols2/wearable/CMakeLists.txt +++ b/examples/quickcontrols2/wearable/CMakeLists.txt @@ -32,12 +32,14 @@ target_link_libraries(wearable PUBLIC Qt::Gui Qt::Quick Qt::QuickControls2 +) # special case begin - # Work around QTBUG-86533 - Qt::QuickTemplates2 +if(UNIX AND NOT APPLE AND CMAKE_CROSSCOMPILING) + find_package(Qt6 COMPONENTS QuickTemplates2) + # Work around QTBUG-86533 + target_link_libraries(wearable PRIVATE Qt::QuickTemplates2) +endif() # special case end -) - # Resources: set(wearable_resource_files -- cgit v1.2.3