From 2a013fec1ccd5b262f0da29b3aa45771fd966294 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 15 Dec 2021 11:19:57 +0100 Subject: [PATCH] CMake: Fix errors about missing qt_setup_tool_path_command.bat.in This amends commit 0bea727cac6b22af05e0ae68b02de6684c98667b or rather reverts it and applies a different fix for QTBUG-98843. Use file(WRITE) instead of configure_file or file(CONFIGURE). This command doesn't have the line endings issues in CMake 3.19 (see QTBUG-98843). It's not problematic that the .bat file gets a new timestamp on every configuration step, since we don't add dependencies on it. Fixes: QTBUG-99223 Task-number: QTBUG-98843 Change-Id: Ibdcd0e4703bf6df42c6a6d0bb2f35c5144bbe30a Reviewed-by: Alexey Edelev --- cmake/QtBuild.cmake | 6 +++--- cmake/qt_setup_tool_path.bat.in | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 cmake/qt_setup_tool_path.bat.in diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8c4c12d593..b06dec60d8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -273,9 +273,9 @@ function(qt_internal_generate_tool_command_wrapper) set(bindir "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_BINDIR}") file(TO_NATIVE_PATH "${bindir}" bindir) set(tool_command_wrapper_path "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt_setup_tool_path.bat") - configure_file("${QT_CMAKE_DIR}/qt_setup_tool_path.bat.in" - "${tool_command_wrapper_path}" @ONLY - NEWLINE_STYLE WIN32) + file(WRITE "${tool_command_wrapper_path}" "@echo off +set PATH=${bindir};%PATH% +%*") set(QT_TOOL_COMMAND_WRAPPER_PATH "${tool_command_wrapper_path}" CACHE INTERNAL "Path to the wrapper of the tool commands") set_property(GLOBAL PROPERTY _qt_internal_generate_tool_command_wrapper_called TRUE) diff --git a/cmake/qt_setup_tool_path.bat.in b/cmake/qt_setup_tool_path.bat.in deleted file mode 100644 index a9cea5ad42..0000000000 --- a/cmake/qt_setup_tool_path.bat.in +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -set PATH=@bindir@;%PATH% -%*