From ec5f4fe580975594edcf7cff42433526a6ec43ba Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 5 Mar 2025 14:38:26 +0100 Subject: [PATCH] Use 'file(CONFIGURE' in qt_configure_file for CMake >= 3.18 Use the original functionality as the fall back solution for the introduced by CMake 'file(CONFIGURE' command. Pick-to: 6.8 6.9 Change-Id: I2be7e3bf80a577cdf8292c9f47bb127fa71615b6 Reviewed-by: Alexandru Croitor --- cmake/QtCMakeHelpers.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtCMakeHelpers.cmake b/cmake/QtCMakeHelpers.cmake index 0fe95f32fdd..c46d0d4a6dc 100644 --- a/cmake/QtCMakeHelpers.cmake +++ b/cmake/QtCMakeHelpers.cmake @@ -14,6 +14,11 @@ macro(qt_configure_file_impl) message(WARNING "Both CONTENT and INPUT are specified. CONTENT will be used to generate" " output") endif() + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) + file(CONFIGURE OUTPUT "${arg_OUTPUT}" CONTENT "${arg_CONTENT}" @ONLY) + return() + endif() + set(template_name "QtFileConfigure.txt.in") # When building qtbase, use the source template file. # Otherwise use the installed file (basically wherever Qt6 package is found).