Add SIGN_UPDATER build option to automatically sign updater.exe during the build on Windows

This requires a script called sign-updater.bat to be present in PATH
or the build directory for updater.exe to perform the signing.
This commit is contained in:
Robert Knight 2011-09-05 16:47:07 +01:00
parent 38bb0e8787
commit 31be2336fb
2 changed files with 11 additions and 0 deletions

View file

@ -3,6 +3,13 @@ project(updater)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") 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)
include_directories(external) include_directories(external)
include_directories(external/TinyThread/source) include_directories(external/TinyThread/source)

View file

@ -118,5 +118,9 @@ target_link_libraries(updater
updatershared updatershared
) )
if (SIGN_UPDATER)
add_custom_command(TARGET updater POST_BUILD COMMAND sign-updater.bat updater.exe)
endif()
install(TARGETS updater RUNTIME DESTINATION bin) install(TARGETS updater RUNTIME DESTINATION bin)