fix(cmake): correct logic for FindPython

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner 2023-12-01 16:44:13 -05:00
parent 574ee0cac1
commit adcf52c69e
No known key found for this signature in database
GPG Key ID: B9D0E45146A241E8

View File

@ -54,7 +54,7 @@ if(NOT Python_FOUND AND NOT Python3_FOUND)
# 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
AND NOT Python_ARTIFACTS_INTERACTIVE AND Python_ARTIFACTS_INTERACTIVE
AND _pybind11_global_keyword STREQUAL "") AND _pybind11_global_keyword STREQUAL "")
if(TARGET Python::Python) if(TARGET Python::Python)
set_property(TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE) set_property(TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE)