diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-25 15:30:20 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-06-25 15:30:20 +0000 |
| commit | 4b5c466b20001ce82878643e99b4b0222497e260 (patch) | |
| tree | 8c5d87829964b2446e27d4779fe7c00ffe866f15 | |
| parent | Fix coding style (diff) | |
| download | inkscape-4b5c466b20001ce82878643e99b4b0222497e260.tar.gz inkscape-4b5c466b20001ce82878643e99b4b0222497e260.zip | |
Update WIX CPack attributes
| -rw-r--r-- | CMakeScripts/CPack.cmake | 34 | ||||
| -rw-r--r-- | CMakeScripts/ConfigCPack.cmake | 8 |
2 files changed, 42 insertions, 0 deletions
diff --git a/CMakeScripts/CPack.cmake b/CMakeScripts/CPack.cmake new file mode 100644 index 000000000..ad10c315e --- /dev/null +++ b/CMakeScripts/CPack.cmake @@ -0,0 +1,34 @@ +# This file reconfigures variables at CPack time. +# +# It is called by +# https://cmake.org/cmake/help/latest/module/CPack.html#variable:CPACK_PROJECT_CONFIG_FILE +# + +#used to get cmake-time variables at cpack-time +set(INKSCAPE_VERSION_SUFFIX @INKSCAPE_VERSION_SUFFIX@) + +if (CPACK_GENERATOR STREQUAL "WIX") + + # for Wix, version should be a.b.c.d with a,b,c between 0 and 255, and + # 0<d<65536. + # We are using the 4th number to store alpha, beta, or rc information + + string(FIND ${INKSCAPE_VERSION_SUFFIX} "alpha" ISALPHA) + string(FIND ${INKSCAPE_VERSION_SUFFIX} "beta" ISBETA) + string(FIND ${INKSCAPE_VERSION_SUFFIX} "rc" ISRC) + string(REGEX_REPLACE "[^0-9]" "" WIX_SUFFIX ${INKSCAPE_VERSION_SUFFIX} ) + + if(ISALPHA GREATER -1) + math(EXPR WIX_SUFFIX "${WIX_SUFFIX} + 10") + elseif(ISBETA GREATER -1) + math(EXPR WIX_SUFFIX "${WIX_SUFFIX} + 20") + elseif(ISRC GREATER -1) + math(EXPR WIX_SUFFIX "${WIX_SUFFIX} + 30") + else() + math(EXPR WIX_SUFFIX "${WIX_SUFFIX} + 100") + endif() + + set(CPACK_PACKAGE_VERSION + "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${WIX_SUFFIX}") + message("WIX version: ${CPACK_PACKAGE_VERSION}") +endif() diff --git a/CMakeScripts/ConfigCPack.cmake b/CMakeScripts/ConfigCPack.cmake index 29d34a007..0949444f7 100644 --- a/CMakeScripts/ConfigCPack.cmake +++ b/CMakeScripts/ConfigCPack.cmake @@ -28,6 +28,8 @@ set(CPACK_SOURCE_GENERATOR "TXZ") set(CPACK_PACKAGE_EXECUTABLES "inkscape;Inkscape;inkview;Inkview") set(CPACK_STRIP_FILES TRUE) set(CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION TRUE) +configure_file("${CMAKE_SOURCE_DIR}/CMakeScripts/CPack.cmake" "${CMAKE_BINARY_DIR}/CMakeScripts/CPack.cmake" @ONLY) +set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeScripts/CPack.cmake") ## Windows ## @@ -41,6 +43,12 @@ if (WIN32) set(CPACK_NSIS_COMPRESSOR "/SOLID zlib") set(CPACK_NSIS_MENU_LINKS "https://inkscape.org/" "Inkscape homepage") endif (NSIS_MAKE) + + #WIX + set(CPACK_WIX_UPGRADE_GUID "4d5fedaa-84a0-48be-bd2a-08246398361a") + set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/share/branding/inkscape.ico") + set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/packaging/wix/Bitmaps/banner.bmp") + set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/packaging/wix/Bitmaps/dialog.bmp") endif (WIN32) ## Linux ## |
