From e16be09f9a9eaf1439a6d749fb2549548025c58f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 10 Aug 2022 19:18:32 +0200 Subject: [PATCH] build: Allow ImHex to open any file types on macOS --- cmake/build_helpers.cmake | 6 +++++- cmake/modules/apple.cmake | 3 --- resources/Info.plist.in | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 4 deletions(-) delete mode 100644 cmake/modules/apple.cmake create mode 100644 resources/Info.plist.in diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 923aabc2d..1d5b8faa9 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -152,6 +152,7 @@ macro(configurePackingResources) set(MACOSX_BUNDLE_ICON_FILE "AppIcon.icns") set(MACOSX_BUNDLE_INFO_STRING "WerWolv") set(MACOSX_BUNDLE_BUNDLE_NAME "ImHex") + set(MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist.in") set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") set(MACOSX_BUNDLE_GUI_IDENTIFIER "net.WerWolv.ImHex") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION}-${GIT_COMMIT_HASH}") @@ -283,7 +284,10 @@ macro(createPackage) endif() if (CREATE_PACKAGE) - include(apple) + set (CPACK_BUNDLE_NAME "ImHex") + set (CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/resources/AppIcon.icns" ) + set (CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/ImHex.app/Contents/Info.plist") + include(CPack) endif() endmacro() diff --git a/cmake/modules/apple.cmake b/cmake/modules/apple.cmake deleted file mode 100644 index bbc80d6ed..000000000 --- a/cmake/modules/apple.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set (CPACK_BUNDLE_NAME "ImHex") -set (CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/resources/AppIcon.icns" ) -set (CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/ImHex.app/Contents/Info.plist") diff --git a/resources/Info.plist.in b/resources/Info.plist.in new file mode 100644 index 000000000..f2c063f48 --- /dev/null +++ b/resources/Info.plist.in @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleTypeExtensions + + * + + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + +