Optionally sign resulting Mac bundle

This commit is contained in:
Mike Gelfand 2022-11-11 17:43:52 +00:00
parent 9e3f477879
commit f29acaac4e
No known key found for this signature in database
GPG Key ID: CC4DBBE3299B16F8
1 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,7 @@
project(trmac)
set(MAC_SIGN_CERT "" CACHE STRING "Application code signing certificate for Mac client")
include_directories(${CMAKE_SOURCE_DIR})
if(CMAKE_GENERATOR STREQUAL "Xcode")
@ -11,6 +13,7 @@ endif()
add_compile_options(-fmodules -fcxx-modules)
find_program(ACTOOL_EXECUTABLE actool REQUIRED)
find_program(CODESIGN_EXECUTABLE codesign REQUIRED)
find_program(IBTOOL_EXECUTABLE ibtool REQUIRED)
macro(tr_wrap_xib IFILE OFILE)
@ -423,6 +426,11 @@ target_link_libraries(${TR_NAME}-mac
"-framework Security"
)
if(MAC_SIGN_CERT AND NOT CMAKE_GENERATOR STREQUAL Xcode)
add_custom_command(TARGET ${TR_NAME}-mac POST_BUILD
COMMAND ${CODESIGN_EXECUTABLE} -f -s "${MAC_SIGN_CERT}" $<TARGET_BUNDLE_DIR:${TR_NAME}-mac>)
endif()
set(MAC_BUNDLE_NAME Transmission)
set_target_properties(${TR_NAME}-mac PROPERTIES