diff --git a/dist/mac/Info.plist b/dist/mac/Info.plist
index 1b045eb00..8506856e8 100644
--- a/dist/mac/Info.plist
+++ b/dist/mac/Info.plist
@@ -37,7 +37,7 @@
CFBundleName
- qBittorrent
+ @EXECUTABLE@
CFBundleIconFile
qbittorrent_mac.icns
CFBundleInfoDictionaryVersion
@@ -49,7 +49,7 @@
CFBundleSignature
qBit
CFBundleExecutable
- qbittorrent
+ @EXECUTABLE@
CFBundleIdentifier
org.qbittorrent
NSPrincipalClass
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index dffe9ffa1..0dffffe49 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -161,10 +161,15 @@ endif (GUI AND WIN32)
target_link_libraries(${QBT_TARGET_NAME} ${QBT_TARGET_LIBRARIES} QtSingleApplication::QtSingleApplication)
if (APPLE)
- set(qbt_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
+ set(qbt_BUNDLE_NAME "${QBT_TARGET_NAME}")
+
+# substitute @EXECUTABLE@ in dist/mac/Info.plist
+ set(EXECUTABLE ${qbt_BUNDLE_NAME})
+ configure_file(${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist @ONLY)
+
set_target_properties(${QBT_TARGET_NAME} PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME "${qbt_BUNDLE_NAME}"
- MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_SOURCE_DIR}/dist/mac/Info.plist
+ MACOSX_BUNDLE_INFO_PLIST ${qBittorrent_BINARY_DIR}/dist/mac/Info.plist
)
endif (APPLE)