diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-21 03:26:40 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-23 01:49:14 +0000 |
| commit | 1a8cb62b8ce5077c99054c1f5a3236e12694e1c7 (patch) | |
| tree | 2793f14f6b15e9655747c6aada0c47e25ce4c64d /CMakeScripts/Dist.cmake | |
| parent | cmake: Prepare script for 'dist'-like targets (diff) | |
| download | inkscape-1a8cb62b8ce5077c99054c1f5a3236e12694e1c7.tar.gz inkscape-1a8cb62b8ce5077c99054c1f5a3236e12694e1c7.zip | |
cmake: Add 'dist' target to create Windows binary archive
- 'dist-win-7z' allows to create a binary distribution archive
compressed with 7z format
- 'dist-win-7z-fast' has slightly worse compression but is
considerably faster
Diffstat (limited to 'CMakeScripts/Dist.cmake')
| -rw-r--r-- | CMakeScripts/Dist.cmake | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/CMakeScripts/Dist.cmake b/CMakeScripts/Dist.cmake index 21d233d87..061e187af 100644 --- a/CMakeScripts/Dist.cmake +++ b/CMakeScripts/Dist.cmake @@ -22,3 +22,41 @@ add_custom_target(dist COMMAND git checkout ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake # duplicate to make sure we actually revert in case of error WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" VERBATIM) + + + +# ----------------------------------------------------------------------------- +# 'dist-win' - Windows Targets +# ----------------------------------------------------------------------------- +if(WIN32) + if(HAVE_MINGW64) + set(bitness "x64") + else() + set(bitness "x86") + endif() + set(INKSCAPE_DIST_PREFIX ${INKSCAPE_DIST_PREFIX}-${bitness}) + + # ----------------------------------------------------------------------------- + # 'dist-win-7z' - generate binary 7z archive for Windows + # ----------------------------------------------------------------------------- + + find_program(7z 7z PATHS "C:\\Program Files\\7-Zip" + "C:\\Program Files (x86)\\7-Zip") + if(NOT 7z) + set(7z echo "Could not find '7z'. Please add it to your search path." && exit 1 &&) + endif() + + # default target with very good but slow compression (needs approx. 10 GB RAM) + add_custom_target(dist-win-7z + COMMAND ${7z} a -mx9 -md512m -mfb256 + "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.7z" + "${CMAKE_INSTALL_PREFIX}") + + # fast target with moderate compression + add_custom_target(dist-win-7z-fast + COMMAND ${7z} a + "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.7z" + "${CMAKE_INSTALL_PREFIX}") + + add_dependencies(dist-win-7z install/strip) + add_dependencies(dist-win-7z-fast install/strip) |
