Skip to content

Commit

Permalink
fix PYTHON_PACKAGES_DIR and SETUPTOOLS_ARG_EXTRA to be up-to-date whe…
Browse files Browse the repository at this point in the history
…n passing -DSETUPTOOLS_DEB_LAYOUT=.. (fix #314)
  • Loading branch information
dirk-thomas committed Jan 17, 2013
1 parent 460de24 commit ed6a326
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ if(APPLE OR MSVC)
endif()

if(SETUPTOOLS_DEB_LAYOUT)
set(PYTHON_PACKAGES_DIR dist-packages CACHE STRING "dist-packages or site-packages")
set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb" CACHE STRING "extra arguments to setuptools")
set(PYTHON_PACKAGES_DIR dist-packages)
set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb")
else()
set(PYTHON_PACKAGES_DIR site-packages CACHE STRING "dist-packages or site-packages")
set(PYTHON_PACKAGES_DIR site-packages)
file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/bin PYTHON_INSTALL_PREFIX) # setuptools is fussy about windows paths
set(SETUPTOOLS_ARG_EXTRA "--install-scripts=${PYTHON_INSTALL_PREFIX}" CACHE STRING "extra arguments to setuptools")
set(SETUPTOOLS_ARG_EXTRA "--install-scripts=${PYTHON_INSTALL_PREFIX}")
endif()

if(NOT MSVC)
set(PYTHON_INSTALL_DIR lib/python${PYTHON_VERSION_XDOTY}/${PYTHON_PACKAGES_DIR}
CACHE INTERNAL "This needs to be in PYTHONPATH when setup.py install is called. And it needs to match. But setuptools won't tell us where it will install things.")
CACHE INTERNAL "This needs to be in PYTHONPATH when 'setup.py install' is called. And it needs to match. But setuptools won't tell us where it will install things.")
else()
# Windows setuptools installs to lib/site-packages not lib/python2.7/site-packages
# Or is this SETUPTOOLS_DEB_LAYOUT dependent?
set(PYTHON_INSTALL_DIR lib/${PYTHON_PACKAGES_DIR}
CACHE INTERNAL "This needs to be in PYTHONPATH when setup.py install is called. And it needs to match. But setuptools won't tell us where it will install things.")
CACHE INTERNAL "This needs to be in PYTHONPATH when 'setup.py install' is called. And it needs to match. But setuptools won't tell us where it will install things.")
endif()

0 comments on commit ed6a326

Please sign in to comment.