From 9204ac23a0c0c0f02553323928f3fe31be69b1e2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 29 Nov 2022 14:40:25 +0100 Subject: [PATCH] CMake: Don't setup deployment when building Qt without examples Introduce the variable QT_SKIP_SETUP_DEPLOYMENT to turn off the generation of deployment support files. Set this variable when building Qt - but only if we're not building examples. This avoids a warning about missing patchelf when building Qt with CMake < 3.21. Change-Id: I8ff5491eb314ff870c210884fbf90dd4c9ad0219 Reviewed-by: Alexandru Croitor --- cmake/QtSetup.cmake | 5 +++++ src/corelib/Qt6CoreMacros.cmake | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 5fc6ed8d98e..7c5cfe90c96 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -354,3 +354,8 @@ to ${FEATURE_${feature}}") Some features will be re-evaluated automatically.") endif() endif() + +if(NOT QT_BUILD_EXAMPLES) + # Disable deployment setup to avoid warnings about missing patchelf with CMake < 3.21. + set(QT_SKIP_SETUP_DEPLOYMENT ON) +endif() diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index bb7df5ed46a..a4b17eda993 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2410,6 +2410,10 @@ endfunction() # Sets up the commands for use at install/deploy time function(_qt_internal_setup_deploy_support) + if(QT_SKIP_SETUP_DEPLOYMENT) + return() + endif() + get_property(cmake_role GLOBAL PROPERTY CMAKE_ROLE) if(NOT cmake_role STREQUAL "PROJECT") return()