1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-08 23:22:25 +02:00

Merge pull request #6180 from kambala-decapitator/macos-fix-deploy

[macOS] fix deploying package
This commit is contained in:
Ivan Savenko
2025-09-28 21:51:43 +03:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -149,7 +149,10 @@ function(vcmi_deploy_qt deployQtToolName deployQtOptions)
find_program(TOOL_DEPLOYQT NAMES ${deployQtToolName} PATHS "${qtBinDir}")
if(TOOL_DEPLOYQT)
install(CODE "
execute_process(COMMAND \"${TOOL_DEPLOYQT}\" ${deployQtOptions} -verbose=2)
execute_process(
COMMAND \"${TOOL_DEPLOYQT}\" ${deployQtOptions} -verbose=2
COMMAND_ERROR_IS_FATAL ANY
)
")
else()
message(WARNING "${deployQtToolName} not found, running cpack would result in broken package")

View File

@@ -3,11 +3,14 @@
if(MACOS)
set(bundleDir "\${CMAKE_INSTALL_PREFIX}/${APP_BUNDLE_DIR}")
set(bundleContentsDir "${bundleDir}/Contents")
set(executablesDir "${bundleContentsDir}/MacOS")
if(ENABLE_LAUNCHER OR ENABLE_EDITOR)
# note: cross-compiled Qt 5 builds macdeployqt for target platform instead of host
vcmi_deploy_qt(macdeployqt "\"${bundleDir}\"")
set(macdeployqtParams "\"${bundleDir}\"")
if(ENABLE_EDITOR)
string(APPEND macdeployqtParams " \"-executable=${executablesDir}/vcmieditor\"")
endif()
# note: cross-compiled Qt 5 builds macdeployqt for target platform instead of host
vcmi_deploy_qt(macdeployqt "${macdeployqtParams}")
# perform ad-hoc codesigning
# Intel Macs don't need it
@@ -29,11 +32,11 @@ if(MACOS)
set(codesignCommandWithEntitlements "${codesignCommand} --entitlements \"${CMAKE_SOURCE_DIR}/osx/entitlements.plist\"")
install(CODE "
execute_process(COMMAND
${codesignCommand} \"${bundleContentsDir}/MacOS/vcmibuilder\"
${codesignCommand} \"${executablesDir}/vcmibuilder\"
)
foreach(executable ${executablesToSign})
execute_process(COMMAND
${codesignCommandWithEntitlements} --identifier eu.vcmi.\${executable} \"${bundleContentsDir}/MacOS/\${executable}\"
${codesignCommandWithEntitlements} --identifier eu.vcmi.\${executable} \"${executablesDir}/\${executable}\"
)
endforeach()
")