Merge pull request #3500 from akva2/backport_PR_3499
fixed: conditionally use Development.XXX in python find module
This commit is contained in:
commit
382c624f10
@ -219,9 +219,17 @@ if (OPM_ENABLE_PYTHON)
|
||||
# We always need to search for Development as we use
|
||||
# pybind11_add_module even if don't embed Python
|
||||
if (NOT OPM_ENABLE_EMBEDDED_PYTHON)
|
||||
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()
|
||||
else()
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Embed 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.Embed Development.Module)
|
||||
endif()
|
||||
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
|
||||
set(PYTHON_LIBRARY ${_lib_path})
|
||||
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
|
||||
|
Loading…
Reference in New Issue
Block a user