Files
lammps/cmake/Modules/Packages/PYTHON.cmake
2025-02-07 20:50:14 -05:00

12 lines
397 B
CMake

if(NOT Python_INTERPRETER)
# backward compatibility with older LAMMPS documentation
if(PYTHON_EXECUTABLE)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
find_package(Python COMPONENTS Interpreter)
endif()
find_package(Python REQUIRED COMPONENTS Interpreter Development)
target_link_libraries(lammps PRIVATE Python::Python)
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)