--- Modules/Platform/Darwin.cmake.orig
+++ Modules/Platform/Darwin.cmake
@@ -237,7 +237,9 @@
endforeach()
endif()
endif()
-list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- /sw # Fink
- /opt/local # MacPorts
- )
+
+# prepend the MacPorts prefix to CMAKE_SYSTEM_PREFIX_PATH
+# might already exist after this if the user has specified it
+list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0
+ __PREFIX__
+)
无奈之下只能自己编译一个 cmake 了。如果你的 MacPorts 使用了默认的 /opt/local 作为 prefix,需要在解压缩 cmake 源码后修改 Darwin.cmake
去掉这行 /opt/local # MacPorts
再安装。