aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtDeclarativeSetup.cmake16
-rw-r--r--src/qml/configure.cmake13
2 files changed, 7 insertions, 22 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()
diff --git a/src/qml/configure.cmake b/src/qml/configure.cmake
index 989c2e3edc..e5fe226d79 100644
--- a/src/qml/configure.cmake
+++ b/src/qml/configure.cmake
@@ -7,9 +7,12 @@
#### Libraries
-# special case begin
qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST MODULE_NAME qml QMAKE_LIB lttng-ust)
-# special case end
+qt_find_package(Python REQUIRED)
+if(Python_Interpreter_FOUND)
+ # Need to make it globally available to the project
+ set(QT_INTERNAL_DECLARATIVE_PYTHON "${Python_EXECUTABLE}" CACHE STRING "")
+endif()
#### Tests
@@ -195,13 +198,9 @@ qt_feature("qml-xmllistmodel" PRIVATE
CONDITION QT_FEATURE_qml_itemmodel AND QT_FEATURE_future
)
-# special case begin
-qt_qml_find_python(__qt_qml_python_path __qt_qml_python_found)
-# special case end
-
qt_feature("qml-python" PRIVATE
LABEL "python"
- CONDITION __qt_qml_python_found # special case
+ CONDITION Python_Interpreter_FOUND
)
qt_configure_add_summary_section(NAME "Qt QML")
qt_configure_add_summary_entry(ARGS "qml-network")