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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user