File 0005-Create-versioned-applications.patch of Package mingw32-qt6-base
From 659a9a2add0050480339d2ffa53b6ed49591b239 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Tue, 5 Mar 2024 15:21:20 +0100
Subject: [PATCH 5/9] Create versioned applications
---
cmake/QtAppHelpers.cmake | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/cmake/QtAppHelpers.cmake b/cmake/QtAppHelpers.cmake
index c0ad53ab9e..f67a2db5c6 100644
--- a/cmake/QtAppHelpers.cmake
+++ b/cmake/QtAppHelpers.cmake
@@ -81,6 +81,14 @@ function(qt_internal_add_app target)
_qt_internal_apply_strict_cpp("${target}")
qt_internal_adjust_main_config_runtime_output_dir("${target}" "${output_directory}")
+ qt_app_target_to_name(name "${target}")
+ if (NOT target STREQUAL name)
+ set_target_properties("${target}" PROPERTIES
+ OUTPUT_NAME ${name}
+ EXPORT_NAME ${name}
+ )
+ endif()
+
# To mimic the default behaviors of qt_app.prf, we by default enable GUI Windows applications,
# but don't enable macOS bundles.
# Bundles are enabled in a separate set_target_properties call if an Info.plist file
@@ -101,6 +109,17 @@ function(qt_internal_add_app target)
qt_add_list_file_finalizer(qt_internal_finalize_app ${target})
endfunction()
+# Returns the tool name for a given tool target.
+# This is the inverse of qt_get_tool_target_name.
+function(qt_app_target_to_name out_var target)
+ set(name ${target})
+ if(QT_APP_NAMES_WITH_VERSION)
+ set(${out_var} ${name}${PROJECT_VERSION_MAJOR} PARENT_SCOPE)
+ else()
+ set(${out_var} ${name} PARENT_SCOPE)
+ endif()
+endfunction()
+
function(qt_internal_get_title_case value out_var)
if(NOT value)
set(${out_var} "" PARENT_SCOPE)
--
2.43.0