diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index c3be11d12e..96db4ebcca 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -45,3 +45,46 @@ qt5_wrap_ui(UI_HEADERS ${UIS}) add_executable(${DOLPHINQT_BINARY} ${SRCS} ${UI_HEADERS}) target_link_libraries(${DOLPHINQT_BINARY} ${LIBS}) qt5_use_modules(${DOLPHINQT_BINARY} Widgets) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # Note: This is based on the DolphinWX version. + + include(BundleUtilities) + set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHINQT_BINARY}.app) + + # Ask for an application bundle. + set_target_properties(${DOLPHINQT_BINARY} PROPERTIES + MACOSX_BUNDLE true + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in + ) + + # get rid of any old copies + file (REMOVE_RECURSE ${BUNDLE_PATH}/Contents/Resources/Sys) + if(NOT SKIP_POSTPROCESS_BUNDLE) + # Fix up the bundle after it is finished. + # There does not seem to be an easy way to run CMake commands post-build, + # so we invoke CMake again on a generated script. + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/postprocess_bundle.cmake " + include(BundleUtilities) + message(\"Fixing up application bundle: ${BUNDLE_PATH}\") + message(\"(Note: This is only necessary to produce a redistributable binary.\") + message(\"To skip, pass -DSKIP_POSTPROCESS_BUNDLE=1 to cmake.)\") + set(BU_CHMOD_BUNDLE_ITEMS ON) + fixup_bundle(\"${BUNDLE_PATH}\" \"\" \"\") + file(INSTALL ${CMAKE_SOURCE_DIR}/Data/Sys + DESTINATION ${BUNDLE_PATH}/Contents/Resources + ) + ") + add_custom_command(TARGET ${DOLPHINQT_BINARY} POST_BUILD + COMMAND ${CMAKE_COMMAND} -P postprocess_bundle.cmake + ) + else() + add_custom_command(OUTPUT ${BUNDLE_PATH}/Contents/Resources/Sys + COMMAND ln -nfs ${CMAKE_SOURCE_DIR}/Data/Sys ${BUNDLE_PATH}/Contents/Resources/Sys + VERBATIM + ) + add_custom_target(CopyDataIntoBundle ALL + DEPENDS ${BUNDLE_PATH}/Contents/Resources/Sys + ) + endif() +endif() diff --git a/Source/Core/DolphinQt/Info.plist.in b/Source/Core/DolphinQt/Info.plist.in new file mode 100644 index 0000000000..aa3f6cb7e2 --- /dev/null +++ b/Source/Core/DolphinQt/Info.plist.in @@ -0,0 +1,80 @@ + + + + + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + ciso + dol + elf + gcm + gcz + iso + wad + wbfs + + CFBundleTypeIconFile + Dolphin.icns + CFBundleTypeName + Nintendo GC/Wii file + CFBundleTypeRole + Viewer + + + CFBundleExecutable + DolphinQt + CFBundleIconFile + Resources/Dolphin.icns + CFBundleIdentifier + org.dolphin-emu.dolphin + CFBundleDevelopmentRegion + English + CFBundleLocalizations + + ar + ca + cs + de + el + en + es + fa + fr + he + hu + it + ja + ko + nb + nl + pl + pt + pt_BR + ru + sr + sv + tr + zh_CN + zh_TW + + CFBundlePackageType + APPL + CFBundleShortVersionString + ${DOLPHIN_WC_DESCRIBE} + CFBundleLongVersionString + ${DOLPHIN_WC_REVISION} + CFBundleVersion + ${DOLPHIN_VERSION_MAJOR}.${DOLPHIN_VERSION_MINOR} + NSHumanReadableCopyright + Licensed under GPL version 2 + LSMinimumSystemVersion + ${OSX_MIN_VERSION} + NSHighResolutionCapable + + CSResourcesFileMapped + + + diff --git a/Source/Core/DolphinQt/Resources/Dolphin.icns b/Source/Core/DolphinQt/Resources/Dolphin.icns new file mode 100644 index 0000000000..4a17b18dec Binary files /dev/null and b/Source/Core/DolphinQt/Resources/Dolphin.icns differ