Enable customization of the tool used to sign the updater

Add a BINARY_SIGNING_TOOL CMake var which can be overridden to specify
a custom script/tool to use to sign the updater binary.
This commit is contained in:
Robert Knight 2013-08-29 15:59:19 +01:00
parent 401785786a
commit dab236d8de
2 changed files with 7 additions and 5 deletions

View file

@ -6,10 +6,12 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
# If the SIGN_UPDATER option is enabled, the updater.exe
# binary is digitally signed on Windows after it has been built.
# A script called sign-updater.bat must exist in the PATH or
# the directory where updater.exe is built. This will be run
# with the path of the binary to sign it.
option(SIGN_UPDATER OFF)
#
# The script used to sign the binary is specified by BINARY_SIGNING_TOOL.
# This tool must take a single argument which is the filename of the
# binary to sign.
option(SIGN_UPDATER "Enable signing of the updater binary" OFF)
set(BINARY_SIGNING_TOOL sign-updater.bat CACHE PATH "Path to the tool used to sign the updater")
include_directories(external)
include_directories(external/TinyThread/source)

View file

@ -130,7 +130,7 @@ target_link_libraries(updater
)
if (SIGN_UPDATER)
add_custom_command(TARGET updater POST_BUILD COMMAND sign-updater.bat updater.exe)
add_custom_command(TARGET updater POST_BUILD COMMAND ${BINARY_SIGNING_TOOL} $<TARGET_FILE:updater>)
endif()
install(TARGETS updater RUNTIME DESTINATION bin)