From 21000ede374e7efb616c27b26d4490cd65d6da3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 20 Apr 2023 12:19:10 +0200 Subject: [PATCH] cmake: Always copy Info.plist to build directory manually Allows us to modify this file in place, before CMake copies it into the application bundle during its generator step. Change-Id: I73325c66b5b8919f57dbaa1cc76a7edbc145609c Reviewed-by: Alexandru Croitor --- cmake/QtPublicAppleHelpers.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmake/QtPublicAppleHelpers.cmake b/cmake/QtPublicAppleHelpers.cmake index 11cfffc3ad1..4de23a00fee 100644 --- a/cmake/QtPublicAppleHelpers.cmake +++ b/cmake/QtPublicAppleHelpers.cmake @@ -531,15 +531,13 @@ function(_qt_internal_set_xcode_bitcode_enablement target) "NO") endfunction() -function(_qt_internal_generate_info_plist target) +function(_qt_internal_copy_info_plist target) # If the project already specifies a custom file, we don't override it. - get_target_property(existing_plist "${target}" MACOSX_BUNDLE_INFO_PLIST) - if(existing_plist) - return() + get_target_property(info_plist_in "${target}" MACOSX_BUNDLE_INFO_PLIST) + if(NOT info_plist_in) + set(info_plist_in "${__qt_internal_cmake_apple_support_files_path}/Info.plist.app.in") endif() - set(info_plist_in "${__qt_internal_cmake_apple_support_files_path}/Info.plist.app.in") - string(MAKE_C_IDENTIFIER "${target}" target_identifier) set(info_plist_out_dir "${CMAKE_CURRENT_BINARY_DIR}/.qt/info_plist/${target_identifier}") @@ -598,7 +596,7 @@ endfunction() function(_qt_internal_finalize_apple_app target) # Shared between macOS and iOS apps - _qt_internal_generate_info_plist("${target}") + _qt_internal_copy_info_plist("${target}") # Only set the various properties if targeting the Xcode generator, otherwise the various # Xcode tokens are embedded as-is instead of being dynamically evaluated.