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 /CMakeScripts/CPack.cmake | |
| parent | Fix coding style (diff) | |
| download | inkscape-4b5c466b20001ce82878643e99b4b0222497e260.tar.gz inkscape-4b5c466b20001ce82878643e99b4b0222497e260.zip | |
Update WIX CPack attributes
Diffstat (limited to 'CMakeScripts/CPack.cmake')
| -rw-r--r-- | CMakeScripts/CPack.cmake | 34 |
1 files changed, 34 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() |
