[waffle] [PATCH 01/18] cmake: include the CPACK module

Emil Velikov emil.l.velikov at gmail.com
Tue Jul 22 20:31:27 PDT 2014


Will be used to ease distribution of binary tarballs.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 CMakeLists.txt | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ce5a86..53c3e3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,3 +128,25 @@ install(
 # ------------------------------------------------------------------------------
 
 include(WafflePrintConfigurationSummary)
+
+set (CPACK_SET_DESTDIR ON)
+set (CPACK_PACKAGE_VERSION_MAJOR ${waffle_major_version})
+set (CPACK_PACKAGE_VERSION_MINOR ${waffle_minor_version})
+set (CPACK_PACKAGE_VERSION_PATCH ${waffle_patch_version})
+
+# cpack detects win64 vs win32 only when msvc is available
+# reported upstream, fix (likely post cmake 3.0) pending
+if (MINGW)
+        if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+                set (CPACK_SYSTEM_NAME win64)
+        endif ()
+endif ()
+
+# See http://www.vtk.org/Wiki/CMake:CPackPackageGenerators
+if (WIN32)
+        set (CPACK_GENERATOR "ZIP")
+else ()
+        set (CPACK_GENERATOR "TBZ2")
+endif ()
+
+include(CPack)
-- 
2.0.2



More information about the waffle mailing list