From 387be08d53b60b1d626cd5525c11e4a03ecaad9c Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 12 Jan 2015 15:12:20 +0100
Subject: [PATCH] OS X package names contain OS X version, e.g. 10.10 for
 Yosemite.

- Enabled Zip packaging on Mac OS.
---
 scripts/cmake/CMakeSetup.cmake             | 17 +++++++++++++++++
 scripts/cmake/packaging/Pack.cmake         |  2 +-
 scripts/cmake/packaging/PackagingMac.cmake |  2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/cmake/CMakeSetup.cmake b/scripts/cmake/CMakeSetup.cmake
index 5768a4ee2ba..7c6a8b3ee21 100644
--- a/scripts/cmake/CMakeSetup.cmake
+++ b/scripts/cmake/CMakeSetup.cmake
@@ -23,3 +23,20 @@ CMAKE_POLICY(SET CMP0011 OLD)
 
 # Get the hostname
 SITE_NAME(HOSTNAME)
+
+# Compute OS X version number
+IF(APPLE)
+	IF(CMAKE_SYSTEM_VERSION VERSION_EQUAL 12.0)
+		SET(OSX_VERSION 10.8 CACHE STRING "OS X version number")
+		SET(OSX_VERSION_NAME CACHE STRING "Mountain Lion")
+	ENDIF()
+	IF(CMAKE_SYSTEM_VERSION VERSION_EQUAL 13.0)
+		SET(OSX_VERSION 10.9 CACHE STRING "OS X version number")
+		SET(OSX_VERSION_NAME CACHE STRING "Mavericks")
+	ENDIF()
+	IF(CMAKE_SYSTEM_VERSION VERSION_EQUAL 14.0)
+		SET(OSX_VERSION 10.10 CACHE STRING "OS X version number")
+		SET(OSX_VERSION_NAME CACHE STRING "Yosemite")
+	ENDIF()
+ENDIF()
+MARK_AS_ADVANCED(OSX_VERSION OSX_VERSION_NAME)
diff --git a/scripts/cmake/packaging/Pack.cmake b/scripts/cmake/packaging/Pack.cmake
index c32d9503541..96256c584a0 100644
--- a/scripts/cmake/packaging/Pack.cmake
+++ b/scripts/cmake/packaging/Pack.cmake
@@ -12,7 +12,7 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "${OGS_VERSION_MAJOR}")
 SET(CPACK_PACKAGE_VERSION_MINOR "${OGS_VERSION_MINOR}")
 SET(CPACK_PACKAGE_VERSION_PATCH "${OGS_VERSION_PATCH}")
 IF(APPLE)
-	SET(CPACK_PACKAGE_FILE_NAME "ogs-${OGS_VERSION}-OSX-x${BITS}")
+	SET(CPACK_PACKAGE_FILE_NAME "ogs-${OGS_VERSION}-OSX-${OSX_VERSION}-x${BITS}")
 	SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
 ELSE()
 	SET(CPACK_PACKAGE_FILE_NAME "ogs-${OGS_VERSION}-${CMAKE_SYSTEM}-x${BITS}")
diff --git a/scripts/cmake/packaging/PackagingMac.cmake b/scripts/cmake/packaging/PackagingMac.cmake
index 2113566e7c6..550da01b9e1 100644
--- a/scripts/cmake/packaging/PackagingMac.cmake
+++ b/scripts/cmake/packaging/PackagingMac.cmake
@@ -1,4 +1,4 @@
-SET(CPACK_GENERATOR "DragNDrop")
+SET(CPACK_GENERATOR DragNDrop ZIP)
 SET(CPACK_DMG_FORMAT "UDBZ")
 
 # See http://stackoverflow.com/a/16662169/80480 how to create the DS_Store file.
-- 
GitLab