Skip to content

Commit

Permalink
Merge pull request #988 from UV-CDAT/fix-pythonpath-apple
Browse files Browse the repository at this point in the history
Setting the correct PYTHON_SITE_PACKAGES_PREFIX on Apple
  • Loading branch information
doutriaux1 committed Jan 29, 2015
2 parents e11b955 + cd3f51e commit 265324f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMake/cdat_modules/python_pkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ add_cdat_package(Python ${PYTHON_MAJOR_SRC}.${PYTHON_MINOR_SRC}.${PYTHON_PATCH_S
set(CDAT_OS_XTRA_PATH "")

set(PYTHON_SITE_PACKAGES_PREFIX ${CMAKE_INSTALL_PREFIX})
set(PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES_PREFIX}/lib/python${PYVER}/site-packages)
if (APPLE)
set(PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES_PREFIX}/Library/Frameworks/Python.framework/Versions/${PYVER}/lib/python${PYVER}/site-packages)
set(PYTHON_SITE_PACKAGES_PREFIX ${CMAKE_INSTALL_PREFIX}/Library/Frameworks/Python.framework/Versions/${PYVER})
endif()
set(PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES_PREFIX}/lib/python${PYVER}/site-packages)
set(PYTHONPATH ${PYTHON_SITE_PACKAGES})

if (CDAT_USE_SYSTEM_PYTHON)
Expand Down
10 changes: 8 additions & 2 deletions CMake/cdat_modules_extra/install.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,15 @@ def get_version():
return Version

def get_prefix():
import os
import os,sys
try:
return os.environ["UVCDAT_SETUP_PATH"]
uv_setup_pth = os.environ["UVCDAT_SETUP_PATH"]
if os.uname()[0] == "Darwin":
uv_setup_pth = os.path.join(uv_setup_pth,
"Library","Frameworks","Python.framework","Versions",
"%i.%i" % (sys.version_info.major,sys.version_info.minor)
)
return uv_setup_pth
except KeyError:
raise RuntimeError("UVCDAT environment not configured. Please source the setup_runtime script.")

Expand Down

0 comments on commit 265324f

Please sign in to comment.