Do not use the imported Python3 library directly.

It just a hassle (need to search for Python3 downstream,
cannot be backwards compatible).
This commit is contained in:
Markus Blatt
2021-03-16 20:15:00 +01:00
parent 1ed6166f1f
commit 9bc0536d13
2 changed files with 2 additions and 8 deletions

View File

@@ -179,10 +179,10 @@ if (OPM_ENABLE_PYTHON)
else()
if (OPM_ENABLE_EMBEDDED_PYTHON)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
set(PYTHON_LIBRARIES Python3::Python)
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
set(PYTHON_LIBRARY ${_lib_path})
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARIES})
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
else()
find_package(Python3 REQUIRED COMPONENTS Interpreter)

View File

@@ -22,10 +22,4 @@ list(APPEND opm-common_DEPS
# as the embedded one.
"fmt 7.0.3"
)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
list(APPEND opm-common_DEPS
# Needed for the imported target Python3::Python
"Python3 COMPONENTS Interpreter Development"
)
endif()
find_package_deps(opm-common)