From 49097d17d597668b1a22305aa4555943b3016a6b Mon Sep 17 00:00:00 2001 From: Luiz Sardinha Date: Sun, 16 Aug 2026 11:22:24 +0200 Subject: [PATCH] build(mac): ensuring the app remains signed after qt's deploy --- CMakeLists.txt | 8 ++++---- deploy/mac/deploy.cmake | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acbe3207c..018f69191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/deploy/mac/deploy.cmake b/deploy/mac/deploy.cmake index d4bcafce7..972d010a1 100644 --- a/deploy/mac/deploy.cmake +++ b/deploy/mac/deploy.cmake @@ -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")