cmake: use macdeployqt instead of fixup_bundle to deploy on macOS

remove unused variable - bundle generator vars are unused by dragndrop

see comments for more info
This commit is contained in:
Brian Heim 2020-10-29 08:51:20 -05:00
parent ebd79e5c13
commit 2480ee81d4
1 changed files with 13 additions and 8 deletions

View File

@ -514,19 +514,24 @@ install( TARGETS ${APP_NAME}
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime ) RUNTIME DESTINATION bin COMPONENT Runtime )
set( APPS ${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app) # Use \$ to defer expansion until install script is called; CPack will call it with its own CMAKE_INSTALL_PREFIX
set( DIRS ${CMAKE_BINARY_DIR} /usr/local/lib) set(APP \${CMAKE_INSTALL_PREFIX}/${APP_NAME}.app)
message(STATUS APPS: ${APPS})
message(STATUS DIRS: ${DIRS} )
set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns ) set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
set(CPACK_BUNDLE_ICON ${CMAKE_SOURCE_DIR}/fceux.icns )
set(CPACK_GENERATOR "DRAGNDROP") set(CPACK_GENERATOR "DRAGNDROP")
include(CPACK) include(CPACK)
install( CODE "include(BundleUtilities) # macdeployqt tool that comes with Qt: https://doc.qt.io/qt-5/macos-deployment.html#macdeploy
fixup_bundle( \"${APPS}\" \"\" \"${DIRS}\") " # Compared to fixup_bundle, correctly finds and installs Qt-specific resources as well as non-Qt dependencies
find_program(MACDEPLOYQT macdeployqt)
if(NOT MACDEPLOYQT)
message(FATAL_ERROR "Could not find macdeployqt executable")
endif()
install( CODE "
message(STATUS \"Deploying and fixing up dependencies in app: ${APP}\")
execute_process(COMMAND \"${MACDEPLOYQT}\" \"${APP}\" -verbose=1)
"
COMPONENT Runtime COMPONENT Runtime
) )