Skip to content

Commit

Permalink
FindPyUblas.cmake: fix Python call.
Browse files Browse the repository at this point in the history
Since Python 3 is the default Python version on some distributions, we
need to use the CMake variable containing the actual Python executable.
  • Loading branch information
Benjamin Chrétien committed Nov 17, 2014
1 parent 7619b5a commit df6940e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeModules/FindPyUblas.cmake
@@ -1,6 +1,6 @@
# try to find the pyublas library

execute_process ( COMMAND python -c "import pyublas; print(pyublas.__path__[0])" OUTPUT_VARIABLE PYUBLAS_OUT OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import pyublas; print(pyublas.__path__[0])" OUTPUT_VARIABLE PYUBLAS_OUT OUTPUT_STRIP_TRAILING_WHITESPACE)

find_path(PYUBLAS_INCLUDE_DIR pyublas/numpy.hpp
HINTS ${PYUBLAS_OUT}/../include ${PYUBLAS_OUT}/include /usr/local/include /usr/include)
Expand Down
2 changes: 1 addition & 1 deletion src/cuv_python/CMakeLists.txt
Expand Up @@ -89,7 +89,7 @@ endif()
SET(PYTHON_VERSION_MAJOR_MINOR ${PYTHON_VERSION_MAJOR_MINOR} CACHE STRING "Python version used")
SET(_PYTHON_PACKAGES_PATH ${_PYTHON_PACKAGES_PATH} CACHE PATH "Where to install python module to")

#execute_process ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
#execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
install(TARGETS cuv_python DESTINATION ${_PYTHON_PACKAGES_PATH}/cuv_python${LIB_SUFFIX})
install(FILES __init__.py DESTINATION ${_PYTHON_PACKAGES_PATH}/cuv_python${LIB_SUFFIX})

Expand Down
2 changes: 1 addition & 1 deletion src/tests/CMakeLists.txt
Expand Up @@ -89,7 +89,7 @@ endif(PYTHONLIBS_FOUND )

IF(CUV_PYTHON_BINDINGS)
SET(ENV{PYTHONPATH} ${CMAKE_BINARY_DIR}/python_bindings )
ADD_TEST( load_py sh -c "PYTHONPATH=${CMAKE_BINARY_DIR}/src python -c 'import cuv_python as cp'" )
ADD_TEST( load_py sh -c "PYTHONPATH=${CMAKE_BINARY_DIR}/src ${PYTHON_EXECUTABLE} -c 'import cuv_python as cp'" )

FIND_PROGRAM(NOSETEST_EXECUTABLE nosetests)
IF(NOSETEST_EXECUTABLE)
Expand Down

0 comments on commit df6940e

Please sign in to comment.