changed: only search for Development.Module if not building embedded python

the embedding headers are not available on the manylinux2014 containers
used to build the pypi packages. since this is anyways more correct
fix it this way
This commit is contained in:
Arne Morten Kvarving 2023-04-27 11:20:41 +02:00
parent f16b433b53
commit 33c416b3e8

View File

@ -218,8 +218,10 @@ if (OPM_ENABLE_PYTHON)
endif()
# We always need to search for Development as we use
# pybind11_add_module even if don't embed Python
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
if (OPM_ENABLE_EMBEDDED_PYTHON)
if (NOT OPM_ENABLE_EMBEDDED_PYTHON)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Embed Development.Module)
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
set(PYTHON_LIBRARY ${_lib_path})
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})