summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------src/3rdparty/qface0
-rw-r--r--src/3rdparty/qt_attribution.json2
-rw-r--r--src/interfaceframework/configure.cmake2
-rw-r--r--src/tools/ifcodegen/CMakeLists.txt26
-rwxr-xr-xsrc/tools/ifcodegen/verify_generator.py46
5 files changed, 71 insertions, 5 deletions
diff --git a/src/3rdparty/qface b/src/3rdparty/qface
-Subproject 4da3732685c91ca0a2e9c6ba2db6515c0f32b80
+Subproject 2459064b0ca85c5fb19cc2a83cc2110be6da4a0
diff --git a/src/3rdparty/qt_attribution.json b/src/3rdparty/qt_attribution.json
index 854898ee..72aed084 100644
--- a/src/3rdparty/qt_attribution.json
+++ b/src/3rdparty/qt_attribution.json
@@ -7,7 +7,7 @@
"Description": "QFace is a generator framework based on a modern IDL.",
"Homepage": "https://pelagicore.github.io/qface",
- "Version": "2.0.6",
+ "Version": "2.0.8",
"License": "MIT License",
"LicenseId": "MIT",
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 2d9e3a45..317d77f5 100644
--- a/src/tools/ifcodegen/CMakeLists.txt
+++ b/src/tools/ifcodegen/CMakeLists.txt
@@ -22,11 +22,13 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/Scripts/activate.bat)
set(VIRTUALENV_ACTIVATE_COMMAND ${VIRTUALENV_ACTIVATE})
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/Scripts/python.exe)
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/Scripts/qface.exe)
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.bat)
else()
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/bin/activate)
set(VIRTUALENV_ACTIVATE_COMMAND . ${VIRTUALENV_ACTIVATE})
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/bin/python)
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/bin/qface)
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.sh)
endif()
@@ -63,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}")
@@ -74,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
@@ -82,16 +94,23 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
- ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
COMMAND ${DEPLOY_VIRTUALENV} qtif_qface_virtualenv
COMMAND ${CMAKE_COMMAND} -E touch .stamp-deploy_virtualenv
- COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
DEPENDS ${IFCODEGEN_BIN}
)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
+ ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
+ COMMAND ${VIRTUALENV_PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/verify_generator.py
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-generator-verified
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
+ COMMENT "Verifying generator"
+ )
+
# main target which just relies on the stamp file to be uptodate
add_custom_target(ifcodegen ALL
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
)
# Create the rerun cmake stamp file here to be able to add cmake configure dependency
@@ -109,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))