build(mac): ensuring the app remains signed after qt's deploy

This commit is contained in:
Luiz Sardinha 2026-08-16 11:22:24 +02:00 committed by Chris Rizzitello
parent 13191a04df
commit 49097d17d5
2 changed files with 9 additions and 5 deletions

View file

@ -242,10 +242,6 @@ add_subdirectory(translations)
add_subdirectory(src)
if(BUILD_INSTALLER)
add_subdirectory(deploy)
endif()
install(
FILES ${PROJECT_SOURCE_DIR}/LICENSE
DESTINATION ${CMAKE_INSTALL_LICENSE_DIR}
@ -256,3 +252,7 @@ install(
DESTINATION ${CMAKE_INSTALL_LICENSE_DIR}
RENAME LICENSE_EXCEPTION
)
if(BUILD_INSTALLER)
add_subdirectory(deploy)
endif()

View file

@ -9,10 +9,14 @@ set(OSX_BUNDLE ${BUILD_OSX_BUNDLE})
set(OS_STRING "macos-${BUILD_ARCHITECTURE}")
if (OSX_BUNDLE)
set(_codesign_identity "-")
if (APPLE_CODESIGN_DEV)
set(_codesign_identity "${APPLE_CODESIGN_DEV}")
endif()
install(CODE "execute_process(COMMAND
${DEPLOYQT}
\"\${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_PROPER_NAME}.app\"
-timestamp -codesign=-
-timestamp \"-codesign=${_codesign_identity}\"
)")
set(CPACK_PACKAGE_ICON "${MY_DIR}/dmg-volume.icns")
set(CPACK_DMG_BACKGROUND_IMAGE "${MY_DIR}/dmg-background.tiff")