Changeset View
Changeset View
Standalone View
Standalone View
files/0001-fix-warning-about-shadertools.patch
- This file was added.
| From 828cbe57a1690c843f4e3de258d465160e599f95 Mon Sep 17 00:00:00 2001 | |||||
| From: Alexandru Croitor <alexandru.croitor@qt.io> | |||||
| Date: Mon, 27 Sep 2021 14:12:25 +0200 | |||||
| Subject: [PATCH] CMake: Fix warning about ShaderTools not being found when | |||||
| building examples | |||||
| When building examples in-tree in a prefix build, we set QT_NO_CREATE_TARGETS | |||||
| to TRUE and that causes find_package(QtFoo) calls in example projects | |||||
| not to define targets. | |||||
| If the targets were not found previously as part of the find_package calls | |||||
| in qtdeclarative/CMakeLists.txt, this generates warnings like | |||||
| CMake Warning at lib/cmake/Qt6/Qt6Config.cmake:176 (find_package): | |||||
| Found package configuration file: | |||||
| lib/cmake/Qt6ShaderTools/Qt6ShaderToolsConfig.cmake | |||||
| but it set Qt6ShaderTools_FOUND to FALSE so package "Qt6ShaderTools" is | |||||
| considered to be NOT FOUND. Reason given by package: | |||||
| Target "Qt6::ShaderTools" was not found. Possibly due to | |||||
| QT_NO_CREATE_TARGETS being set to TRUE and thus | |||||
| lib/cmake/Qt6ShaderTools/Qt6ShaderToolsTargets.cmake | |||||
| was not included to define the target. | |||||
| To avoid the warnings, search for the target ShaderTools package as an | |||||
| optional component. | |||||
| Amends 0d517b553bb8e94262d54439d3e16086896c1b7d | |||||
| Pick-to: 6.2 | |||||
| Fixes: QTBUG-96358 | |||||
| Change-Id: I50c2f1516ca26c099559001e74b7e25c625be6e6 | |||||
| Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> | |||||
| Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> | |||||
| --- | |||||
| CMakeLists.txt | 5 +++++ | |||||
| 1 file changed, 5 insertions(+) | |||||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | |||||
| index b43ebd075d..1f1eeffb03 100644 | |||||
| --- a/CMakeLists.txt | |||||
| +++ b/CMakeLists.txt | |||||
| @@ -35,6 +35,11 @@ if(NOT "${QT_HOST_PATH}" STREQUAL "") | |||||
| set(CMAKE_FIND_ROOT_PATH ${_qt_backup_qtdeclarative_CMAKE_FIND_ROOT_PATH}) | |||||
| endif() | |||||
| +# Optionally look for the target ShaderTools package to avoid warnings | |||||
| +# when configuring the project to build examples in-tree in a prefix Qt build. | |||||
| +# See QTBUG-96358 for details. | |||||
| +find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS ShaderTools) | |||||
| + | |||||
| # special case begin | |||||
| # export QT6_ADD_QML_MODULE to this project | |||||
| include(src/qml/Qt6QmlMacros.cmake) | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.