Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the correct PYTHON_SITE_PACKAGES_PREFIX on Apple #988

Merged
merged 4 commits into from
Jan 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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