summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/interfaceframework/configure.cmake2
-rw-r--r--src/tools/ifcodegen/CMakeLists.txt11
-rwxr-xr-xsrc/tools/ifcodegen/verify_generator.py46
3 files changed, 58 insertions, 1 deletions
diff --git a/src/interfaceframework/configure.cmake b/src/interfaceframework/configure.cmake
index ebf016c1..af4ad02f 100644
--- a/src/interfaceframework/configure.cmake
+++ b/src/interfaceframework/configure.cmake
@@ -100,7 +100,7 @@ qt_configure_add_summary_entry(
CONDITION NOT QT_FEATURE_interfaceframework
)
qt_configure_add_report_entry(
- TYPE ERROR
+ TYPE WARNING
# special case begin
MESSAGE [[
Cannot build the Interface Framework Generator because its dependencies are not satisfied.
diff --git a/src/tools/ifcodegen/CMakeLists.txt b/src/tools/ifcodegen/CMakeLists.txt
index 22b0c366..68aaa76a 100644
--- a/src/tools/ifcodegen/CMakeLists.txt
+++ b/src/tools/ifcodegen/CMakeLists.txt
@@ -65,6 +65,15 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
# someone is working on the qface sources
file(GLOB_RECURSE IFCODEGEN_SOURCE_FILES ${IFCODEGEN_SOURCE_DIR}/*.py)
+ # If the upstream python packages introduce a regression this option can be used to install
+ # the minimum version for all required python package and produce a working setup
+ # Those packages might be outdated and may contain security holes, but they are known to be
+ # working.
+ set(INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND)
+ if (QT_USE_MINIMAL_QFACE_PACKAGES)
+ set(INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND COMMAND pip3 install -r ${IFCODEGEN_SOURCE_DIR}/requirements_minimal.txt)
+ endif()
+
# On the CI we use the special wheel folder when available to not download all packages again on each build
set(PYTHON3_WHEEL_CACHE "$ENV{PYTHON3_WHEEL_CACHE}" CACHE PATH "Python3 wheel cache")
if (EXISTS "${PYTHON3_WHEEL_CACHE}")
@@ -76,6 +85,7 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
add_custom_command(OUTPUT ${IFCODEGEN_BIN}
COMMAND ${VIRTUALENV_ACTIVATE_COMMAND}
+ ${INSTALL_MINIMAL_QFACE_PACKAGES_COMMAND}
COMMAND ${PIP3_INSTALL_COMMAND}
DEPENDS ${VIRTUALENV_ACTIVATE}
${IFCODEGEN_SOURCE_DIR}/requirements.txt
@@ -118,6 +128,7 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
#####################################################################
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
${VIRTUALENV_PATH}
diff --git a/src/tools/ifcodegen/verify_generator.py b/src/tools/ifcodegen/verify_generator.py
new file mode 100755
index 00000000..c3f85d65
--- /dev/null
+++ b/src/tools/ifcodegen/verify_generator.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python3
+#############################################################################
+##
+## Copyright (C) 2022 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the QtInterfaceFramework module of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+try:
+ import generate
+except Exception as e:
+ raise SystemExit("""
+ Verifying the generator failed!
+
+ This might be caused by a too recent python version or
+ too recent python packages. You can try installing older
+ python packages by running configure again with the the
+ following option:
+
+ -DQT_USE_MINIMAL_QFACE_PACKAGES=TRUE
+
+ The python error was:
+
+ {}
+ """.format(e))