diff --git a/macosx/CMakeLists.txt b/macosx/CMakeLists.txt index c3aa16aa4..2443001cf 100644 --- a/macosx/CMakeLists.txt +++ b/macosx/CMakeLists.txt @@ -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}" $) +endif() + set(MAC_BUNDLE_NAME Transmission) set_target_properties(${TR_NAME}-mac PROPERTIES