summaryrefslogtreecommitdiffstats
path: root/CMakeCPackOptions.cmake.in
diff options
context:
space:
mode:
authorNils Gladitz <gladitz@scivis.de>2012-10-03 14:08:49 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-12-03 16:00:31 (GMT)
commit85baac1503c638756211ba07c4c25128e6d3d845 (patch)
treec10451adf45938e9bc6573d9edd09d4e3a67de67 /CMakeCPackOptions.cmake.in
parent581b0c0d078b5f07f68a53b118f44fc6e8313601 (diff)
downloadCMake-85baac1503c638756211ba07c4c25128e6d3d845.zip
CMake-85baac1503c638756211ba07c4c25128e6d3d845.tar.gz
CMake-85baac1503c638756211ba07c4c25128e6d3d845.tar.bz2
CPack: Add a WiX Generator (#11575)
This new CPack generator produces an *.msi installer file. Requires having the WiX Toolset installed in order to work properly. Download the WiX Toolset installer "WiX36.exe" here: http://wix.codeplex.com/releases/view/93929
Diffstat (limited to 'CMakeCPackOptions.cmake.in')
-rw-r--r--CMakeCPackOptions.cmake.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index 3a72eaa..47dad49 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -51,3 +51,27 @@ if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
endif()
endif()
+
+if("${CPACK_GENERATOR}" STREQUAL "WIX")
+ # Reset CPACK_PACKAGE_VERSION to deal with WiX restriction.
+ # But the file names still use the full CMake_VERSION value:
+ set(CPACK_PACKAGE_FILE_NAME
+ "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-${CPACK_SYSTEM_NAME}")
+ set(CPACK_SOURCE_PACKAGE_FILE_NAME
+ "${CPACK_PACKAGE_NAME}-@CMake_VERSION@-Source")
+
+ if(NOT CPACK_WIX_SIZEOF_VOID_P)
+ set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
+ endif()
+
+ set(CPACK_PACKAGE_VERSION
+ "@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@.@CMake_VERSION_PATCH@")
+ # WIX installers require at most a 4 component version number, where
+ # each component is an integer between 0 and 65534 inclusive
+ set(tweak "@CMake_VERSION_TWEAK@")
+ if(tweak MATCHES "^[0-9]+$")
+ if(tweak GREATER 0 AND tweak LESS 65535)
+ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${tweak}")
+ endif()
+ endif()
+endif()