File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,22 @@ if(NOT Python_FOUND AND NOT Python3_FOUND)
3232 set (Python_ROOT_DIR "$ENV{pythonLocation} " )
3333 endif ()
3434
35- find_package (Python 3.6 REQUIRED COMPONENTS Interpreter Development ${_pybind11_quiet} )
35+ # Development.Module support (required for manylinux) started in 3.18
36+ if (CMAKE_VERSION VERSION_LESS 3.18)
37+ set (_pybind11_dev_component Development)
38+ else ()
39+ set (_pybind11_dev_component Development.Module OPTIONAL_COMPONENTS Development.Embed)
40+ endif ()
41+
42+ find_package (Python 3.6 REQUIRED COMPONENTS Interpreter ${_pybind11_dev_component}
43+ ${_pybind11_quiet} )
3644
3745 # If we are in submodule mode, export the Python targets to global targets.
3846 # If this behavior is not desired, FindPython _before_ pybind11.
3947 if (NOT is_config)
40- set_property (TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE )
48+ if (TARGET Python::Python)
49+ set_property (TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE )
50+ endif ()
4151 set_property (TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE )
4252 if (TARGET Python::Module)
4353 set_property (TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ endif()
4343
4444# A user can set versions manually too
4545set (Python_ADDITIONAL_VERSIONS
46- "3.11;3.10;3.9;3.8;3.7;3.6"
46+ "3.12;3. 11;3.10;3.9;3.8;3.7;3.6"
4747 CACHE INTERNAL "" )
4848
4949list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} " )
You can’t perform that action at this time.
0 commit comments