aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-12-17 15:21:37 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-01-20 19:33:01 +0100
commite0eb75b2a0578f4ef401bb6eaa8c4f320ffa2078 (patch)
tree9377df44ea47df547e1e989da5c218100f676e08 /cmake
parent65e4c76b9fa128aa372e34a3e663950636d6cdb6 (diff)
CMake: Fix lookup of Python for qtdeclarative
Always use FindPython instead of find_program because the former looks for Python in more locations (like the Windows registry). We switch to FindPython instead of FindPythonInterp because the latter is deprecated, and the former is available in our minimum support CMake version (3.16). Because find_package is called in configure.cmake that is called by a function() call, we need to make the found interpreter a cache variable to make it available outside of the function. Pick-to: 6.2 6.3 Fixes: QTBUG-99273 Change-Id: Idb6620a01b4b5764f130f9dc5780d73cd2151965 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtDeclarativeSetup.cmake16
1 files changed, 1 insertions, 15 deletions
diff --git a/cmake/QtDeclarativeSetup.cmake b/cmake/QtDeclarativeSetup.cmake
index 82cfbd935f..98ea95dd58 100644
--- a/cmake/QtDeclarativeSetup.cmake
+++ b/cmake/QtDeclarativeSetup.cmake
@@ -35,8 +35,6 @@ function(qt_declarative_write_tag_header target_name)
endif()
endfunction()
-find_package(PythonInterp REQUIRED)
-
# Generate a header file containing a regular expression jit table.
function(qt_declarative_generate_reg_exp_jit_tables consuming_target)
set(generate_dir "${CMAKE_CURRENT_BINARY_DIR}/.generated")
@@ -51,21 +49,9 @@ function(qt_declarative_generate_reg_exp_jit_tables consuming_target)
add_custom_command(
OUTPUT "${output_file}"
- COMMAND "${PYTHON_EXECUTABLE}" ${retgen_script_file} ${output_file}
+ COMMAND "${QT_INTERNAL_DECLARATIVE_PYTHON}" ${retgen_script_file} ${output_file}
MAIN_DEPENDENCY ${retgen_script_file}
)
target_sources(${consuming_target} PRIVATE ${output_file})
target_include_directories(${consuming_target} PRIVATE $<BUILD_INTERFACE:${generate_dir}>)
endfunction()
-
-function(qt_qml_find_python out_var_path out_var_found)
- find_program(QT_QML_PYTHON_PATH
- NAMES python python2 python3 py
- DOC "Qt Declarative python path")
- if(QT_QML_PYTHON_PATH)
- set(${out_var_path} "${QT_QML_PYTHON_PATH}" PARENT_SCOPE)
- set(${out_var_found} "TRUE" PARENT_SCOPE)
- else()
- set(${out_var_found} "FALSE" PARENT_SCOPE)
- endif()
-endfunction()