diff --git a/doomsday/cmake/Macros.cmake b/doomsday/cmake/Macros.cmake index 8c9e3f8f8c..645fc80c18 100644 --- a/doomsday/cmake/Macros.cmake +++ b/doomsday/cmake/Macros.cmake @@ -443,6 +443,10 @@ macro (deng_codesign target) \"\${CMAKE_INSTALL_PREFIX}/${_outName}.app\" )") endif () + if (WIN32 AND DENG_SIGNTOOL_CERT) + get_property (_outName TARGET ${target} PROPERTY OUTPUT_NAME) + deng_signtool (${CMAKE_INSTALL_PREFIX}/bin/${_outName}.exe) + endif () endmacro () # Defines a new GUI application target that includes all the required Doomsday diff --git a/doomsday/cmake/PlatformMacx.cmake b/doomsday/cmake/PlatformMacx.cmake index ceb9bf4812..3440e5fed4 100644 --- a/doomsday/cmake/PlatformMacx.cmake +++ b/doomsday/cmake/PlatformMacx.cmake @@ -7,6 +7,7 @@ set (DENG_AMETHYST_PLATFORM MACOSX) set (DENG_INSTALL_DOC_DIR "Doomsday.app/Contents/Resources/doc") set (DENG_INSTALL_MAN_DIR ${DENG_INSTALL_DOC_DIR}) +# Code signing. set (DENG_CODESIGN_APP_CERT "" CACHE STRING "ID of the certificate for signing applications.") find_program (CODESIGN_COMMAND codesign) mark_as_advanced (CODESIGN_COMMAND) diff --git a/doomsday/cmake/PlatformWindows.cmake b/doomsday/cmake/PlatformWindows.cmake index 839df4c7b7..f72ebd81bc 100644 --- a/doomsday/cmake/PlatformWindows.cmake +++ b/doomsday/cmake/PlatformWindows.cmake @@ -14,6 +14,24 @@ add_definitions ( -D_USE_MATH_DEFINES ) +# Code signing. +set (DENG_SIGNTOOL_CERT "" CACHE FILEPATH "Path of the certificate for signing files.") +set (DENG_SIGNTOOL_PASSPHRASE "" CACHE STRING "Signing certificate passphrase.") +find_program (SIGNTOOL_COMMAND signtool) +mark_as_advanced (SIGNTOOL_COMMAND) + +function (deng_signtool path) + install (CODE " + message (STATUS "\Signing ${path}...\") + execute_process (COMMAND ${SIGNTOOL_COMMAND} + /f ${DENG_SIGNTOOL_CERT} + /p ${DENG_SIGNTOOL_PASSPHRASE} + /t http://timestamp.verisign.com/scripts/timstamp.dll + \"${path}\" + )" + ) +endfunction () + if (MSVC) add_definitions ( -DMSVC