From 28ef33b0a0e49b9869d77e61d09971062f09499c Mon Sep 17 00:00:00 2001 From: Nick Korotysh Date: Fri, 23 Apr 2021 02:24:00 +0300 Subject: [PATCH] Improve Info.plist generation with CMake - drop configure_file() and file(GENERATE) calls - fill missed MACOSX_DEPLOYMENT_TARGET variable --- dist/mac/Info.plist | 2 +- src/app/CMakeLists.txt | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dist/mac/Info.plist b/dist/mac/Info.plist index 7c476027e..9a1cd43cc 100644 --- a/dist/mac/Info.plist +++ b/dist/mac/Info.plist @@ -57,7 +57,7 @@ CFBundleShortVersionString 4.4.0 CFBundleExecutable - @EXECUTABLE@ + ${EXECUTABLE_NAME} CFBundleIdentifier org.qbittorrent.qBittorrent LSMinimumSystemVersion diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 36907d415..665fe7f0a 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -75,18 +75,14 @@ set_source_files_properties( ) if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # substitute @EXECUTABLE@ in dist/mac/Info.plist - get_target_property(EXECUTABLE qbt_app OUTPUT_NAME) - configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist - ${qBittorrent_BINARY_DIR}/dist/mac/pregen.plist @ONLY) - file(GENERATE - OUTPUT ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist - INPUT ${qBittorrent_BINARY_DIR}/dist/mac/pregen.plist - ) + # provide variables for substitution in dist/mac/Info.plist + get_target_property(EXECUTABLE_NAME qbt_app OUTPUT_NAME) + # This variable name should be changed once qmake is no longer used. Refer to the discussion in PR #14813 + set(MACOSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}) set_target_properties(qbt_app PROPERTIES MACOSX_BUNDLE ON MACOSX_BUNDLE_BUNDLE_NAME "qBittorrent" - MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist + MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ) target_sources(qbt_app PRIVATE ${QT_TRANSLATIONS}