Use custom .plist.in template

This is the standard way to add custom attributes in a plist file
with cmake. We need to set NSHighResolutionCapable to true in order
to properly render the app on Retina screens
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce55a24..054c2f9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,10 @@
   CMAKE_POLICY(SET CMP0022 NEW)
 ENDIF(POLICY CMP0022)
 
-PROJECT(Ring)
+SET(PROJ_NAME Ring)
+SET(RING_VERSION 1.0)
+
+PROJECT(${PROJ_NAME})
 
 ADD_DEFINITIONS("-std=c++0x")
 
@@ -40,34 +43,38 @@
    mainwindox.h
    mysearchbar.h)
 
-MESSAGE("BINARY IS HERE:" ${LIB_RING_CLIENT_LIBRARY})
-
-SET(MACOSX_BUNDLE_DISPLAY_NAME Ring)
-SET(MACOSX_BUNDLE_BUNDLE_NAME Ring)
-SET(MACOSX_BUNDLE_BUNDLE_VERSION 1.0)
-
 # Icons
 
 # NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
 # the property added to Info.plist
-SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)
+#SET(MACOSX_BUNDLE_ICON_FILE appicon.icns)
 
 # And this part tells CMake where to find and install the file itself
 SET(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/data/appicon.icns)
 SET_SOURCE_FILES_PROPERTIES(${myApp_ICON} PROPERTIES
        MACOSX_PACKAGE_LOCATION "Resources")
 
-ADD_EXECUTABLE(Ring MACOSX_BUNDLE
+ADD_EXECUTABLE(${PROJ_NAME} MACOSX_BUNDLE
    ${ringclient_SRCS}
    ${ringclient_HEADERS_MOC}
    ${ringclient_FORMS_HEADERS}
    ${myApp_ICON})
 
-
-TARGET_LINK_LIBRARIES( Ring
+TARGET_LINK_LIBRARIES( ${PROJ_NAME}
    ${LIB_RING_CLIENT_LIBRARY}
    ${QT_QTCORE_LIBRARY}
    ${Qt5Widgets_LIBRARIES}
    ${QT_QTGUI_LIBRARY}
 )
 
+SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES
+        MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in
+        MACOSX_BUNDLE_GUI_IDENTIFIER "cx.ring"
+        MACOSX_BUNDLE_SHORT_VERSION_STRING ${RING_VERSION}
+        MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJ_NAME} ${RING_VERSION} Nightly"
+        MACOSX_BUNDLE_BUNDLE_VERSION ${RING_VERSION}
+        MACOSX_BUNDLE_COPYRIGHT "${PROJ_NAME}"
+        MACOSX_BUNDLE_INFO_STRING "Nightly build of ${PROJ_NAME} ${RING_VERSION} for testing and development"
+        MACOSX_BUNDLE_BUNDLE_NAME ${PROJ_NAME}
+        MACOSX_BUNDLE_ICON_FILE "appicon.icns"
+    )
diff --git a/cmake/MacOSXBundleInfo.plist.in b/cmake/MacOSXBundleInfo.plist.in
new file mode 100644
index 0000000..1045c15
--- /dev/null
+++ b/cmake/MacOSXBundleInfo.plist.in
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
+	<key>CFBundleGetInfoString</key>
+	<string>${MACOSX_BUNDLE_INFO_STRING}</string>
+	<key>CFBundleIconFile</key>
+	<string>${MACOSX_BUNDLE_ICON_FILE}</string>
+	<key>CFBundleIdentifier</key>
+	<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleLongVersionString</key>
+	<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+	<key>CFBundleName</key>
+	<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
+	<key>CSResourcesFileMapped</key>
+	<true/>
+	<key>LSRequiresCarbon</key>
+	<true/>
+	<key>NSHumanReadableCopyright</key>
+	<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
+    <key>NSHighResolutionCapable</key>
+    <string>True</string>
+</dict>
+</plist>