diff --git a/cmake/macros/FixPathForNSIS.cmake b/cmake/macros/FixPathForNSIS.cmake new file mode 100644 index 0000000000..22ee538ed7 --- /dev/null +++ b/cmake/macros/FixPathForNSIS.cmake @@ -0,0 +1,16 @@ +# +# FixPathForNSIS.cmake +# +# Created by Sam Gateau on 1/14/16. +# Copyright 2016 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +macro(fix_path_for_nsis INITIAL_PATH RESULTING_PATH) + # replace forward slash with backslash + string(REPLACE "/" "\\\\" _BACKSLASHED_PATH ${INITIAL_PATH}) + # set the resulting path variable + set(${RESULTING_PATH} ${_BACKSLASHED_PATH}) +endmacro() diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index f3c03ca141..4ca1ff714b 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -24,7 +24,13 @@ macro(GENERATE_INSTALLERS) set(CPACK_NSIS_PACKAGE_NAME ${_DISPLAY_NAME}) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${_DISPLAY_NAME}) set(CPACK_NSIS_MUI_ICON "${HF_CMAKE_DIR}/installer/installer.ico") - set(INSTALLER_HEADER_IMAGE "${HF_CMAKE_DIR}/installer/installer-header.bmp") + + if (WIN32) + # use macro to put backslashes in header image path since nsis requires them + set(_INSTALLER_HEADER_BAD_PATH "${HF_CMAKE_DIR}/installer/installer-header.bmp") + set(INSTALLER_HEADER_IMAGE "") + fix_path_for_nsis(${_INSTALLER_HEADER_BAD_PATH} INSTALLER_HEADER_IMAGE) + endif() set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")