forked from lijiext/lammps
PYTHON.cmake: don't use PythonLibs on new cmake
This commit is contained in:
parent
6f5fcd66ac
commit
909b2dcff8
|
@ -1,6 +1,11 @@
|
|||
if(PKG_PYTHON)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(PythonLibs REQUIRED) # Deprecated since version 3.12
|
||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIR})
|
||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARY})
|
||||
else()
|
||||
find_package(Python REQUIRED COMPONENTS Development)
|
||||
target_link_libraries(lammps PRIVATE Python::Python)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)
|
||||
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIR})
|
||||
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARY})
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue