use string replace to escape signtool path

This commit is contained in:
Stephen Birarda 2016-01-12 18:04:35 -08:00
parent 0d2b8f183e
commit b9ccef6c2c
2 changed files with 6 additions and 2 deletions

View file

@ -63,11 +63,15 @@ macro(SET_PACKAGING_PARAMETERS)
# check if we need to find signtool
if (PRODUCTION_BUILD OR PR_BUILD)
find_program(SIGNTOOL_EXECUTABLE signtool PATHS "C:\\Program\ Files\ (x86)\\Windows\ Kits\\8.1" PATH_SUFFIXES "bin/x64")
find_program(SIGNTOOL_EXECUTABLE signtool PATHS "C:/Program Files (x86)/Windows Kits/8.1" PATH_SUFFIXES "bin/x64")
if (NOT SIGNTOOL_EXECUTABLE)
message(FATAL_ERROR "Code signing of executables was requested but signtool.exe could not be found.")
endif ()
# perform a string replacement on the produced path so it is ready for NSIS
string(REPLACE "/" "\\\\" _SIGNTOOL_EXECUTABLE_BACKSLASH ${SIGNTOOL_EXECUTABLE})
string(REPLACE " " "\\ " SIGNTOOL_EXECUTABLE_ESCAPED ${_SIGNTOOL_EXECUTABLE_BACKSLASH})
endif ()
endif ()

View file

@ -18,4 +18,4 @@ set(PRODUCTION_BUILD "@PRODUCTION_BUILD@")
set(POST_INSTALL_OPTIONS_PATH "@POST_INSTALL_OPTIONS_PATH@")
set(CLIENT_COMPONENT_NAME "@CLIENT_COMPONENT@")
set(SERVER_COMPONENT_NAME "@SERVER_COMPONENT@")
set(SIGNTOOL_EXECUTABLE "@SIGNTOOL_EXECUTABLE@")
set(SIGNTOOL_EXECUTABLE "@SIGNTOOL_EXECUTABLE_ESCAPED@")