Use ${PYTHON_EXECUTABLE} instead of 'python' in CMakeLists.txt

This commit is contained in:
Joakim Hove 2019-10-04 20:14:27 +02:00
parent 04eb33771c
commit 204ea1a1a2
3 changed files with 5 additions and 5 deletions

View File

@ -256,7 +256,7 @@ if (OPM_ENABLE_PYTHON)
python/cxx/table_manager.cpp
python/cxx/well.cpp
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/python/ ${CMAKE_BINARY_DIR}/python
COMMAND python ${CMAKE_BINARY_DIR}/python/setup.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python/setup.py
build
build_ext
--build-lib=${CMAKE_BINARY_DIR}/python/python/opm
@ -268,11 +268,11 @@ if (OPM_ENABLE_PYTHON)
add_dependencies(opmcommon_python opmcommon)
install( CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} )" )
install( CODE "execute_process(COMMAND python python/setup.py build_ext --dry-run install --prefix=${CMAKE_INSTALL_PREFIX} )" )
install( CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} python/setup.py build_ext --dry-run install --prefix=${CMAKE_INSTALL_PREFIX} )" )
add_test(NAME python_tests
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/python
COMMAND python setup.py build_ext --dry-run --build-lib ${CMAKE_BINARY_DIR}/python/python/opm test
COMMAND ${PYTHON_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${CMAKE_BINARY_DIR}/python/python/opm test
)
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)

View File

@ -14,6 +14,6 @@ rm -f python/opm/libopmcommon_python.so
export CC=@CMAKE_CXX_COMPILER@
python setup.py build build_ext --build-lib=python/opm \
@PYTHON_EXECUTABLE@ setup.py build build_ext --build-lib=python/opm \
--library-dirs=@_setup_lib_dirs@ \
--include-dirs=@_setup_include_dirs@

View File

@ -14,4 +14,4 @@ export PYTHONPPATH=@PROJECT_BINARY_DIR@/python/python:$PYTHONPATH
export LD_LIBRARY_PATH=@PROJECT_BINARY_DIR@/lib:@_setup_lib_dirs@:$LD_LIBRARY_PATH
python setup.py build_ext --dry-run --build-lib=python/opm test
@PYTHON_EXECUTABLE@ setup.py build_ext --dry-run --build-lib=python/opm test