Index: files/patch-Modules-FindQt4.cmake.diff
===================================================================
--- files/patch-Modules-FindQt4.cmake.diff	(revision 0)
+++ files/patch-Modules-FindQt4.cmake.diff	(revision 0)
@@ -0,0 +1,55 @@
+--- Modules/FindQt4.cmake.orig	2010-11-18 09:49:17.000000000 -0500
++++ Modules/FindQt4.cmake	2010-11-18 09:53:21.000000000 -0500
+@@ -580,7 +580,8 @@
+     SET(QT_MKSPECS_DIR NOTFOUND)
+     FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri
+       HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
+-      DOC "The location of the Qt mkspecs containing qconfig.pri")
++      DOC "The location of the Qt mkspecs containing qconfig.pri"
++      NO_DEFAULT_PATH)
+   ENDIF()
+ 
+   IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+@@ -604,12 +605,12 @@
+     FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
+                  NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4
+                  HINTS ${QT_LIBRARY_DIR_TMP}
+-                 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
++                 NO_DEFAULT_PATH
+         )
+     FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG
+                  NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4
+                  HINTS ${QT_LIBRARY_DIR_TMP}
+-                 NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
++                 NO_DEFAULT_PATH
+         )
+ 
+     # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+@@ -663,6 +664,7 @@
+                 HINTS ${qt_headers}
+                 ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+                 PATH_SUFFIXES QtCore
++		NO_DEFAULT_PATH
+         )
+ 
+       # Set QT_HEADERS_DIR based on finding QtCore header
+@@ -711,7 +713,8 @@
+     endforeach(qt_cross_path)
+     FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer
+       HINTS ${qt_cross_paths} ${qt_plugins_dir}
+-      DOC "The location of the Qt plugins")
++      DOC "The location of the Qt plugins"
++      NO_DEFAULT_PATH)
+   ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR  OR  QT_QMAKE_CHANGED)
+ 
+   # ask qmake for the translations directory
+@@ -731,8 +734,7 @@
+       FIND_PATH(QT_IMPORTS_DIR NAMES Qt
+         HINTS ${qt_cross_paths} ${qt_imports_dir}
+         DOC "The location of the Qt imports"
+-        NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+-        NO_CMAKE_SYSTEM_PATH)
++        NO_DEFAULT_PATH)
+       mark_as_advanced(QT_IMPORTS_DIR)
+     endif(qt_imports_dir)
+   ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR  OR  QT_QMAKE_CHANGED)
Index: files/macports.cmake
===================================================================
--- files/macports.cmake	(revision 73590)
+++ files/macports.cmake	(working copy)
@@ -1,4 +1,3 @@
-# Use ncurses to use the MacPorts ncurses
-set(CURSES_USE_NCURSES TRUE)
-set(CURSES_NEED_NCURSES TRUE)
-set(CURSES_CURSES_LIBRARY ${CURSES_NCURSES_LIBRARY})
+# Coerce CMake to use the MacPorts ncurses library
+# patch __PREFIX__ in the Portfile post-patch stage
+set(CURSES_CURSES_LIBRARY "__PREFIX__/lib/libncurses.dylib" CACHE FILEPATH "The Curses Library" FORCE)
Index: Portfile
===================================================================
--- Portfile	(revision 73590)
+++ Portfile	(working copy)
@@ -6,6 +6,7 @@
 
 name		cmake
 version		2.8.3
+revision    1
 set branch	[join [lrange [split ${version} .] 0 1] .]
 categories	devel
 maintainers	css
@@ -31,9 +32,19 @@
 
 configure.args	--mandir=/share/man --docdir=/share/doc/cmake \
 				--parallel=${build.jobs} \
-				--init=${filespath}/macports.cmake
-patchfiles	patch-CMakeFindFrameworks.cmake.diff
+				--init=${worksrcpath}/macports.cmake
+configure.universal_args
+configure.post_args
+
+patchfiles	patch-CMakeFindFrameworks.cmake.diff \
+            patch-Modules-FindQt4.cmake.diff
+
 post-patch {
+    # copy cmake init file, ready to be patched below
+    copy ${filespath}/macports.cmake ${worksrcpath}
+
+    # patch PREFIX
+	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/macports.cmake
 	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Modules/CMakeFindFrameworks.cmake
 }
 
@@ -47,9 +58,6 @@
 		} else {
 			set dirs ${worksrcpath}
 		}
-		foreach dir ${dirs} {
-			reinplace "s|/usr/lib/libcurses|${prefix}/lib/libncurses|g" ${dir}/CMakeCache.txt
-		}
 	}
 }
 
