From 4e46567438c8896ee5e431e98ffe4c1f6fef77ca Mon Sep 17 00:00:00 2001 From: Matt Lamont Date: Sun, 5 Apr 2020 17:40:58 +1200 Subject: [PATCH] Specify an NSPrincipalClass in Info.plist to enable Retina display support The default Info.plist template provided by CMake doesn't have this key, and CMake only has minimal support for settingstypically found in this file. In order to specify NSPrincipalClass, we need to provide the whole Info.plist instead. Info.plist is also specified as a dependancy to the application so that it will appear in the project explorer, and changes to this file will trigger a rebuild. --- CMakeLists.txt | 7 ++----- mac/Info.plist | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 mac/Info.plist diff --git a/CMakeLists.txt b/CMakeLists.txt index fe87293..964edcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ set(HEADERS config.h imagewriter.h networkaccessmanagerfactory.h nan.h drivelist # Add 3rd-party dependencies if (APPLE) set_source_files_properties("icons/rpi-imager.icns" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") -set(DEPENDENCIES mac/macfile.cpp mac/macfile.h dependencies/mountutils/src/darwin/functions.cpp +set(DEPENDENCIES mac/macfile.cpp mac/macfile.h mac/Info.plist dependencies/mountutils/src/darwin/functions.cpp dependencies/drivelist/src/darwin/list.mm dependencies/drivelist/src/darwin/REDiskList.m icons/rpi-imager.icns) enable_language(OBJC C) elseif (UNIX) @@ -192,10 +192,7 @@ elseif(APPLE) #find_package(Qt5 COMPONENTS Svg) #set(EXTRALIBS ${CoreFoundation} ${DiskArbitration} ${Security} ${Cocoa} Qt5::Svg) set(EXTRALIBS ${CoreFoundation} ${DiskArbitration} ${Security} ${Cocoa}) - set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE YES - MACOSX_BUNDLE_BUNDLE_NAME "Raspberry Pi Imager" - MACOSX_BUNDLE_GUI_IDENTIFIER "org.raspberrypi.imagingutility" - MACOSX_BUNDLE_ICON_FILE "rpi-imager.icns") + set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE YES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist) find_program(MACDEPLOYQT "macdeployqt" PATHS "${Qt5_DIR}/../../../bin") if (NOT MACDEPLOYQT) diff --git a/mac/Info.plist b/mac/Info.plist new file mode 100644 index 0000000..3f2232e --- /dev/null +++ b/mac/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + rpi-imager + CFBundleGetInfoString + + CFBundleIconFile + rpi-imager.icns + CFBundleIdentifier + org.raspberrypi.imagingutility + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + + CFBundleName + Raspberry Pi Imager + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + + CSResourcesFileMapped + + NSHumanReadableCopyright + + NSPrincipalClass + NSApplication + +