From 34d7dd908e135ce2036c4fa7ce3e2099174d4e8c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 29 Nov 2022 10:17:07 +0100 Subject: [PATCH] CMake: Fix configuring Qt with CMake < 3.21 and missing patchelf Turn the FATAL_ERROR into a WARNING and explain what patchelf would be used for. Also, store the patchelf executable just as "patchelf" if it could not be found. Now it's possible to install patchelf after configuring a project. Fixes: QTBUG-109004 Change-Id: I1e89b4c5851f341e000e563d1437398b454c68f7 Reviewed-by: Alexandru Croitor --- src/corelib/Qt6CoreMacros.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index baf8fcb5784..bb7df5ed46a 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -2518,8 +2518,10 @@ function(_qt_internal_setup_deploy_support) if(QT_DEPLOY_USE_PATCHELF) find_program(QT_DEPLOY_PATCHELF_EXECUTABLE patchelf) if(NOT QT_DEPLOY_PATCHELF_EXECUTABLE) - message(FATAL_ERROR "The patchelf executable could not be located. " - "Please install patchelf or upgrade CMake to 3.21 or newer.") + set(QT_DEPLOY_PATCHELF_EXECUTABLE "patchelf") + message(WARNING "The patchelf executable could not be located. " + "To use Qt's CMake deployment API, install patchelf or upgrade CMake to 3.21 " + "or newer.") endif() endif() endif()