summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-01-03 22:36:34 (GMT)
committerBrad King <brad.king@kitware.com>2003-01-03 22:36:34 (GMT)
commit624a222df3d98052d2ee9a72a0a56836045f4d1d (patch)
tree92dbb4442c251ba5770afe95cfd1494865057854 /Modules
parentad6fb556536c4e81491c0f932bbe8ed22948a219 (diff)
downloadCMake-624a222df3d98052d2ee9a72a0a56836045f4d1d.zip
CMake-624a222df3d98052d2ee9a72a0a56836045f4d1d.tar.gz
CMake-624a222df3d98052d2ee9a72a0a56836045f4d1d.tar.bz2
ENH: Find python framework on Mac OSX.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPythonLibs.cmake42
1 files changed, 33 insertions, 9 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 5ab35a8..ab1d3aa 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -48,6 +48,20 @@ FIND_LIBRARY(PYTHON_LIBRARY
)
FIND_PATH(PYTHON_INCLUDE_PATH Python.h
+ ~/Library/Frameworks/Python.framework/Headers
+ /Library/Frameworks/Python.framework/Headers
+ ~/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3
+ /Library/Frameworks/Python.framework/Versions/2.3/include/python2.3
+ ~/Library/Frameworks/Python.framework/Versions/2.2/include/python2.2
+ /Library/Frameworks/Python.framework/Versions/2.2/include/python2.2
+ ~/Library/Frameworks/Python.framework/Versions/2.1/include/python2.1
+ /Library/Frameworks/Python.framework/Versions/2.1/include/python2.1
+ ~/Library/Frameworks/Python.framework/Versions/2.0/include/python2.0
+ /Library/Frameworks/Python.framework/Versions/2.0/include/python2.0
+ ~/Library/Frameworks/Python.framework/Versions/1.6/include/python1.6
+ /Library/Frameworks/Python.framework/Versions/1.6/include/python1.6
+ ~/Library/Frameworks/Python.framework/Versions/1.5/include/python1.5
+ /Library/Frameworks/Python.framework/Versions/1.5/include/python1.5
/usr/include/python2.3
/usr/include/python2.2
/usr/include/python2.1
@@ -74,12 +88,22 @@ ENDIF(WIN32)
# Python Should be built and installed as a Framework on OSX
IF (APPLE)
- IF (EXISTS ~/Library/Frameworks/Python.framework)
- SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
- SET (PYTHON_INCLUDE_PATH "~/Library/Frameworks/Python.framework/Headers" CACHE INTERNAL "Hack into the framework")
- ENDIF (EXISTS ~/Library/Frameworks/Python.framework)
- IF (EXISTS /Library/Frameworks/Python.framework)
- SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
- SET (PYTHON_INCLUDE_PATH "/Library/Frameworks/Python.framework/Headers" CACHE INTERNAL "Hack into the framework")
- ENDIF (EXISTS /Library/Frameworks/Python.framework)
-ENDIF (APPLE) \ No newline at end of file
+ IF(EXISTS ~/Library/Frameworks/Python.framework)
+ SET(PYTHON_HAVE_FRAMEWORK 1)
+ ENDIF(EXISTS ~/Library/Frameworks/Python.framework)
+ IF(EXISTS /Library/Frameworks/Python.framework)
+ SET(PYTHON_HAVE_FRAMEWORK 1)
+ ENDIF(EXISTS /Library/Frameworks/Python.framework)
+ IF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
+ SET(PYTHON_LIBRARY "")
+ SET(PYTHON_DEBUG_LIBRARY "")
+ ENDIF("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
+ IF(PYTHON_HAVE_FRAMEWORK)
+ IF(NOT PYTHON_LIBRARY)
+ SET (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
+ ENDIF(NOT PYTHON_LIBRARY)
+ IF(NOT PYTHON_DEBUG_LIBRARY)
+ SET (PYTHON_DEBUG_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
+ ENDIF(NOT PYTHON_DEBUG_LIBRARY)
+ ENDIF(PYTHON_HAVE_FRAMEWORK)
+ENDIF (APPLE)