remove special case CMake code for versions before 3.16
This commit is contained in:
@ -12,20 +12,12 @@ if(NOT BUILD_SHARED_LIBS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
find_package(PythonInterp 3.6) # Deprecated since version 3.12
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
endif()
|
||||
else()
|
||||
find_package(Python COMPONENTS Interpreter Development)
|
||||
endif()
|
||||
find_package(Python 3.6 COMPONENTS Interpreter Development)
|
||||
|
||||
if(PKG_PYTHON)
|
||||
add_executable(test_python_package test_python_package.cpp)
|
||||
target_link_libraries(test_python_package PRIVATE lammps GTest::GMock)
|
||||
target_compile_definitions(test_python_package PRIVATE -DTEST_INPUT_FOLDER=${TEST_INPUT_FOLDER})
|
||||
# this requires CMake 3.12. don't care to add backward compatibility for this.
|
||||
if(Python_Development_FOUND)
|
||||
target_compile_definitions(test_python_package PRIVATE -DTEST_HAVE_PYTHON_DEVELOPMENT=1)
|
||||
target_link_libraries(test_python_package PRIVATE Python::Python)
|
||||
|
||||
Reference in New Issue
Block a user