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)
32
32
set (Python_ROOT_DIR "$ENV{pythonLocation} " )
33
33
endif ()
34
34
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} )
36
44
37
45
# If we are in submodule mode, export the Python targets to global targets.
38
46
# If this behavior is not desired, FindPython _before_ pybind11.
39
47
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 ()
41
51
set_property (TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE )
42
52
if (TARGET Python::Module )
43
53
set_property (TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ endif()
43
43
44
44
# A user can set versions manually too
45
45
set (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"
47
47
CACHE INTERNAL "" )
48
48
49
49
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} " )
You can’t perform that action at this time.
0 commit comments