File tree 1 file changed +12
-2
lines changed 1 file changed +12
-2
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 )
You can’t perform that action at this time.
0 commit comments