Merge pull request #4618 from akva2/fix_python_old_cmake

fixed: conditionally use Development.XXX in python find module
This commit is contained in:
Arne Morten Kvarving 2023-05-02 09:30:18 +02:00 committed by GitHub
commit 579e4a49ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,11 @@ if (OPM_ENABLE_PYTHON)
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
if(${CMAKE_VERSION} VERSION_LESS "3.18.0")
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
endif()
endif()
if(Python3_VERSION_MINOR LESS 3)
# Python native namespace packages requires python >= 3.3