mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-31 15:20:34 +00:00
Merge branch 'master' into sh_merge_master
This commit is contained in:
commit
fb79bc8c14
@ -32,12 +32,22 @@ if(NOT Python_FOUND AND NOT Python3_FOUND)
|
|||||||
set(Python_ROOT_DIR "$ENV{pythonLocation}")
|
set(Python_ROOT_DIR "$ENV{pythonLocation}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Python 3.6 REQUIRED COMPONENTS Interpreter Development ${_pybind11_quiet})
|
# Development.Module support (required for manylinux) started in 3.18
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.18)
|
||||||
|
set(_pybind11_dev_component Development)
|
||||||
|
else()
|
||||||
|
set(_pybind11_dev_component Development.Module OPTIONAL_COMPONENTS Development.Embed)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Python 3.6 REQUIRED COMPONENTS Interpreter ${_pybind11_dev_component}
|
||||||
|
${_pybind11_quiet})
|
||||||
|
|
||||||
# If we are in submodule mode, export the Python targets to global targets.
|
# If we are in submodule mode, export the Python targets to global targets.
|
||||||
# If this behavior is not desired, FindPython _before_ pybind11.
|
# If this behavior is not desired, FindPython _before_ pybind11.
|
||||||
if(NOT is_config)
|
if(NOT is_config)
|
||||||
set_property(TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE)
|
if(TARGET Python::Python)
|
||||||
|
set_property(TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE)
|
||||||
|
endif()
|
||||||
set_property(TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE)
|
set_property(TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE)
|
||||||
if(TARGET Python::Module)
|
if(TARGET Python::Module)
|
||||||
set_property(TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE)
|
set_property(TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE)
|
||||||
|
@ -43,7 +43,7 @@ endif()
|
|||||||
|
|
||||||
# A user can set versions manually too
|
# A user can set versions manually too
|
||||||
set(Python_ADDITIONAL_VERSIONS
|
set(Python_ADDITIONAL_VERSIONS
|
||||||
"3.11;3.10;3.9;3.8;3.7;3.6"
|
"3.12;3.11;3.10;3.9;3.8;3.7;3.6"
|
||||||
CACHE INTERNAL "")
|
CACHE INTERNAL "")
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
Loading…
Reference in New Issue
Block a user