|
|
|
@ -3740,6 +3740,14 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
|
|
|
|
|
_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
|
|
|
|
|
_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (WIN32 AND _${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "t${CMAKE_IMPORT_LIBRARY_SUFFIX}$")
|
|
|
|
|
# On windows, header file is shared between the different implementations
|
|
|
|
|
# So Py_GIL_DISABLED should be set explicitly
|
|
|
|
|
set (${_PYTHON_PREFIX}_DEFINITIONS Py_GIL_DISABLED=1)
|
|
|
|
|
else()
|
|
|
|
|
unset (${_PYTHON_PREFIX}_DEFINITIONS)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if ("SABI_LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
|
|
|
|
@ -3769,6 +3777,14 @@ if (("Development.Module" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
|
|
|
|
|
_${_PYTHON_PREFIX}_RUNTIME_SABI_LIBRARY_RELEASE
|
|
|
|
|
_${_PYTHON_PREFIX}_RUNTIME_SABI_LIBRARY_DEBUG)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (WIN32 AND _${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE MATCHES "t${CMAKE_IMPORT_LIBRARY_SUFFIX}$")
|
|
|
|
|
# On windows, header file is shared between the different implementations
|
|
|
|
|
# So Py_GIL_DISABLED should be set explicitly
|
|
|
|
|
set (${_PYTHON_PREFIX}_DEFINITIONS Py_GIL_DISABLED=1)
|
|
|
|
|
else()
|
|
|
|
|
unset (${_PYTHON_PREFIX}_DEFINITIONS)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE OR _${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE OR _${_PYTHON_PREFIX}_INCLUDE_DIR)
|
|
|
|
@ -3903,11 +3919,12 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
|
|
|
|
|
|
|
|
|
|
# Workaround Intel MKL library outputting a message in stdout, which cause
|
|
|
|
|
# incorrect detection of numpy.get_include() and numpy.__version__
|
|
|
|
|
# See https://github.com/numpy/numpy/issues/23775
|
|
|
|
|
if(DEFINED ENV{MKL_ENABLE_INSTRUCTIONS})
|
|
|
|
|
set(_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS ENV{MKL_ENABLE_INSTRUCTIONS})
|
|
|
|
|
# See https://github.com/numpy/numpy/issues/23775 and
|
|
|
|
|
# https://gitlab.kitware.com/cmake/cmake/-/issues/26240
|
|
|
|
|
if(NOT DEFINED ENV{MKL_ENABLE_INSTRUCTIONS})
|
|
|
|
|
set(_${_PYTHON_PREFIX}_UNSET_ENV_VAR_MKL_ENABLE_INSTRUCTIONS YES)
|
|
|
|
|
set(ENV{MKL_ENABLE_INSTRUCTIONS} "SSE4_2")
|
|
|
|
|
endif()
|
|
|
|
|
set(ENV{MKL_ENABLE_INSTRUCTIONS} "SSE4_2")
|
|
|
|
|
|
|
|
|
|
if (NOT _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
|
|
|
|
|
execute_process(COMMAND ${${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
|
|
|
|
@ -3949,11 +3966,9 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
|
|
|
|
|
set (${_PYTHON_PREFIX}_NumPy_FOUND FALSE)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Restore previous value of MKL_ENABLE_INSTRUCTIONS
|
|
|
|
|
if(DEFINED _${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
|
|
|
|
|
set(ENV{MKL_ENABLE_INSTRUCTIONS} ${_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS})
|
|
|
|
|
unset(_${_PYTHON_PREFIX}_BACKUP_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
|
|
|
|
|
else()
|
|
|
|
|
# Unset MKL_ENABLE_INSTRUCTIONS if set by us
|
|
|
|
|
if(DEFINED _${_PYTHON_PREFIX}_UNSET_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
|
|
|
|
|
unset(_${_PYTHON_PREFIX}_UNSET_ENV_VAR_MKL_ENABLE_INSTRUCTIONS)
|
|
|
|
|
unset(ENV{MKL_ENABLE_INSTRUCTIONS})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
@ -4067,6 +4082,12 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
|
|
|
|
|
set_property (TARGET ${__name}
|
|
|
|
|
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_INCLUDE_DIRS}")
|
|
|
|
|
|
|
|
|
|
if (${_PYTHON_PREFIX}_DEFINITIONS)
|
|
|
|
|
set_property (TARGET ${__name}
|
|
|
|
|
PROPERTY INTERFACE_COMPILE_DEFINITIONS "${${_PYTHON_PREFIX}_DEFINITIONS}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (${_PYTHON_PREFIX}_${_PREFIX}LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_RUNTIME_${_PREFIX}LIBRARY_RELEASE)
|
|
|
|
|
# System manage shared libraries in two parts: import and runtime
|
|
|
|
|
if (${_PYTHON_PREFIX}_${_PREFIX}LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_${_PREFIX}LIBRARY_DEBUG)
|
|
|
|
@ -4123,6 +4144,11 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
|
|
|
|
|
set_property (TARGET ${__name}
|
|
|
|
|
PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_INCLUDE_DIRS}")
|
|
|
|
|
|
|
|
|
|
if (${_PYTHON_PREFIX}_DEFINITIONS)
|
|
|
|
|
set_property (TARGET ${__name}
|
|
|
|
|
PROPERTY INTERFACE_COMPILE_DEFINITIONS "${${_PYTHON_PREFIX}_DEFINITIONS}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# When available, enforce shared library generation with undefined symbols
|
|
|
|
|
if (APPLE)
|
|
|
|
|
set_property (TARGET ${__name}
|
|
|
|
|