# 1. Load environment or any previously detected Python
IF(DEFINED ENV{PYTHON_ROOT_DIR})
FILE(TO_CMAKE_PATH "$ENV{PYTHON_ROOT_DIR}" _PYTHON_ROOT_DIR_ENV)
- SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}")
+ IF(APPLE)
+ SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current")
+ SET(PYTHON_LIBRARY "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current/lib/libpython2.7.dylib")
+ SET(PYTHON_INCLUDE_DIR "${_PYTHON_ROOT_DIR_ENV}/Python.framework/Versions/Current/Headers")
+ LIST(APPEND CMAKE_PREFIX_PATH "${_dflt_value}")
+ FIND_PACKAGE(PythonLibs)
+ MESSAGE(STATUS "Mac Python: ${_dflt_value}")
+ MESSAGE(STATUS "Python libraries: ${PYTHON_LIBRARY}")
+ MESSAGE(STATUS "Python include dir: ${PYTHON_INCLUDE_DIR}")
+ ELSE(APPLE)
+ SET(_dflt_value "${_PYTHON_ROOT_DIR_ENV}")
+ ENDIF(APPLE)
ELSE()
# will be blank if no Python was previously loaded
SET(_dflt_value "${PYTHON_ROOT_DIR_EXP}")