--- CMake/Utils/FindPkgMacros.cmake.orig	2011-11-10 23:45:41.000000000 +0100
+++ CMake/Utils/FindPkgMacros.cmake	2011-11-10 23:42:30.000000000 +0100
@@ -126,7 +126,8 @@
 # Slightly customised framework finder
 MACRO(findpkg_framework fwk)
   IF(APPLE)
-    SET(${fwk}_FRAMEWORK_PATH
+    SET(${fwk}_FRAMEWORK_PATH "")   # The pessimistic assumption
+    SET(${fwk}_FRAMEWORK_TEMP_SEARCH_PATH
       ${${fwk}_FRAMEWORK_SEARCH_PATH}
       ${CMAKE_FRAMEWORK_PATH}
       ~/Library/Frameworks
@@ -138,20 +139,19 @@
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
     )
     # These could be arrays of paths, add each individually to the search paths
-    foreach(i ${OGRE_PREFIX_PATH})
-      set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
+    foreach(i ${OGRE_PREFIX_PATH} ${OGRE_PREFIX_BUILD})
+      LIST(APPEND ${fwk}_FRAMEWORK_TEMP_SEARCH_PATH
+	${i}/lib/Release ${i}/lib/Debug)
     endforeach(i)
 
-    foreach(i ${OGRE_PREFIX_BUILD})
-      set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
-    endforeach(i)
-
-    FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
+    FOREACH(dir ${${fwk}_FRAMEWORK_TEMP_SEARCH_PATH})
       SET(fwkpath ${dir}/${fwk}.framework)
       IF(EXISTS ${fwkpath})
-        SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
-          ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
-        SET(${fwk}_FRAMEWORK_PATH ${dir})
+	IF (NOT ${fwk}_FRAMEWORK_PATH)
+          SET(${fwk}_FRAMEWORK_PATH ${dir})
+          SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
+            ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
+	ENDIF()
         if (NOT ${fwk}_LIBRARY_FWK)
           SET(${fwk}_LIBRARY_FWK "-framework ${fwk}")
         endif ()
