From eda2669780362bbecd52429088ff6b9512fdb2b3 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 4 Oct 2018 12:09:54 -0700 Subject: [PATCH] CMake: Installer buildscript fixes --- CHANGES | 1 + CMakeLists.txt | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 116b8df40..1853b26e8 100644 --- a/CHANGES +++ b/CHANGES @@ -105,6 +105,7 @@ Features: - Switch: Rumble support - Switch: Rotation support - Qt: State file load/save menu options + - Windows installer Bugfixes: - PSP2: Fix audio crackling after fast forward - PSP2: Fix audio crackling when buffer is full diff --git a/CMakeLists.txt b/CMakeLists.txt index 0668c1bee..4d35bc242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1055,22 +1055,28 @@ else() add_custom_target(LICENSE ALL DEPENDS LICENSE.txt) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CHANGES.txt ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT ${BINARY_NAME}) if(DISTBUILD AND WIN32) - set(INSTALLER "${PROJECT_NAME}-setup-${CLEAN_VERSION_STRING}-win${WIN_BITS}.exe") + if(INSTALLER_NAME) + set(INSTALLER_TARGET "${INSTALLER_NAME}.exe") + set(ISCC_FLAGS "/F${INSTALLER_NAME}") + else() + set(INSTALLER_TARGET "${PROJECT_NAME}-setup-${CLEAN_VERSION_STRING}-win${WIN_BITS}.exe") + endif() if(CMAKE_CROSSCOMPILING) find_program(WINE NAMES wine wine-stable wine-development) - find_file(ISCC ISCC.exe HINTS "$ENV{HOME}/.wine/drive_c/Program Files/") - add_custom_command(OUTPUT ${INSTALLER} - COMMAND "${WINE}" "${ISCC}" setup.iss /Q + find_file(ISCC ISCC.exe HINTS "$ENV{HOME}/.wine/drive_c/Program Files/" PATH_SUFFIXES "Inno Setup 5") + message(STATUS "${WINE}" "${ISCC}" setup.iss /Q ${ISCC_FLAGS}) + add_custom_command(OUTPUT ${INSTALLER_TARGET} + COMMAND "${WINE}" "${ISCC}" setup.iss /Q ${ISCC_FLAGS} DEPENDS ${BINARY_NAME}-qt ${BINARY_NAME}-sdl CHANGES LICENSE) else() - find_program(ISCC NAMES ISSC ISSC.exe) - add_custom_command(OUTPUT ${INSTALLER} - COMMAND "${ISCC}" setup.iss /Q + find_program(ISCC NAMES ISCC ISCC.exe PATH_SUFFIXES "Inno Setup 5") + add_custom_command(OUTPUT ${INSTALLER_TARGET} + COMMAND "${ISCC}" setup.iss /Q ${ISCC_FLAGS} DEPENDS ${BINARY_NAME}-qt ${BINARY_NAME}-sdl CHANGES LICENSE) endif() if(ISCC) - add_custom_target(installer ALL DEPENDS ${INSTALLER}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${INSTALLER}" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT installer) + add_custom_target(installer ALL DEPENDS ${INSTALLER_TARGET}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${INSTALLER_TARGET}" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT installer) endif() endif() endif()