make python support more portable, require python3

This commit is contained in:
Axel Kohlmeyer
2020-10-21 14:14:16 -04:00
parent 53028b24d6
commit d7a0971578
2 changed files with 4 additions and 4 deletions

View File

@ -70,9 +70,9 @@ endif()
if(BUILD_SWIG_PYTHON)
set_property(SOURCE lammps.i PROPERTY SWIG_MODULE_NAME pylammps)
swig_add_library(pylammps TYPE MODULE LANGUAGE python SOURCES lammps.i)
find_package(Python REQUIRED COMPONENTS Development)
swig_link_libraries(pylammps PRIVATE lammps Python::Python)
configure_file(run_python_example.sh run_python_example.sh COPYONLY)
find_package(Python3 REQUIRED COMPONENTS Development Interpreter)
swig_link_libraries(pylammps PRIVATE lammps Python3::Python)
configure_file(run_python_example.sh.in run_python_example.sh @ONLY)
endif()
if(BUILD_SWIG_RUBY)

View File

@ -60,4 +60,4 @@ PYTHONPATH=${PWD}:${PYTHONPATH-${PWD}}
export PYTHONPATH
python example.py
@Python3_EXECUTABLE@ example.py