cmake, refactor: Switch to Python3::Interpreter imported target

Imported targets are more robust than using variables.
This commit is contained in:
Hennadii Stepanov committed 2025-07-01 10:48:22 +01:00
1 parent ed7a841f82
commit bb9157db5d
4 files changed
+9 -11

No files matched your search

+1 -3
View File
@@ -590,9 +590,7 @@ set(Python3_FIND_FRAMEWORK LAST CACHE STRING "")
set(Python3_FIND_UNVERSIONED_NAMES FIRST CACHE STRING "")
mark_as_advanced(Python3_FIND_FRAMEWORK Python3_FIND_UNVERSIONED_NAMES)
find_package(Python3 3.10 COMPONENTS Interpreter)
if(Python3_EXECUTABLE)
set(PYTHON_COMMAND ${Python3_EXECUTABLE})
else()
if(NOT TARGET Python3::Interpreter)
list(APPEND configure_warnings
"Minimum required Python not found. Rpcauth tests are disabled."
)