--- Source/QtDialog/CMakeLists.txt.orig
+++ Source/QtDialog/CMakeLists.txt
@@ -308,7 +308,8 @@
     OUTPUT_NAME CMake
     MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
     MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}"
-    # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
+    MACOSX_BUNDLE_LONG_VERSION_STRING "${CMAKE_BUNDLE_VERSION}-MacPorts"
+    MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
     MACOSX_BUNDLE_COPYRIGHT "${copyright_line}"
     MACOSX_BUNDLE_GUI_IDENTIFIER "org.cmake.cmake"
     )
@@ -345,8 +346,12 @@
 endif()
 
 if(APPLE)
+  # at install time, create a symlink from the CMake executable to
+  # bin/cmake-gui. Note that there is a build-time symlink created
+  # above, but it is used just during build and test, and not
+  # installed. This one is created in the installation.
   install(CODE "
-    execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui
+    execute_process(COMMAND ln -s \"${CMAKE_BUNDLE_LOCATION}/CMake.app/Contents/MacOS/CMake\" cmake-gui
         WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)
   " ${COMPONENT})
 endif()
--- Source/QtDialog/Info.plist.in.orig
+++ Source/QtDialog/Info.plist.in
@@ -2,8 +2,15 @@
 <!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>LSEnvironment</key>
+        <dict>
+                <key>PATH</key>
+                <string>${CMAKE_INSTALL_PREFIX}/bin:${CMAKE_INSTALL_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+        </dict>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>English</string>
+        <key>CFBundleGetInfoString</key>
+        <string>CMake - Cross Platform Makefile Generator</string>
 	<key>CFBundleExecutable</key>
 	<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
 	<key>CFBundleIconFile</key>
@@ -16,6 +23,8 @@
 	<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
+        <key>CFBundleLongVersionString</key>
+        <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
 	<key>CFBundleShortVersionString</key>
 	<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
 	<key>CFBundleSignature</key>
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -440,12 +440,20 @@
     if(APPLE)
       set(CMAKE_BUNDLE_VERSION
         "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
-      set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
-      # make sure CMAKE_INSTALL_PREFIX ends in /
-      if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$")
-        string(APPEND CMAKE_INSTALL_PREFIX "/")
+      if(CMAKE_BUNDLE_LOCATION)
+        message(STATUS "Using provided bundle location: ${CMAKE_BUNDLE_LOCATION}")
+        message(STATUS "Using default install prefix: ${CMAKE_INSTALL_PREFIX}")
+      else()
+        set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
+        # make sure CMAKE_INSTALL_PREFIX ends in /
+        if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$")
+          set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
+        endif()
+        set(CMAKE_INSTALL_PREFIX
+          "${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
+        message(STATUS "Using default Qt bundle location: ${CMAKE_BUNDLE_LOCATION}")
+        message(STATUS "Using special install prefix: ${CMAKE_INSTALL_PREFIX}")
       endif()
-      string(APPEND CMAKE_INSTALL_PREFIX "CMake.app/Contents")
     endif()
   endif()
 
