diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-03-25 10:20:03 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-04-09 09:05:11 +0200 |
commit | f619b4c45b042c3a656a80b57cb4f154ef15bd1a (patch) | |
tree | b17adfd7c0f0bd9984a464380c49a1215f4db2c2 /sources/pyside6 | |
parent | 7cea5aad257b12b34c8fec89cc4750fe0f3c4bbb (diff) |
Fix building without QtOpenGL
Introduce a CMake macro to either add the dependency
or an entry to the dropped items for typesystem parsing.
Pick-to: 6.7
Fixes: PYSIDE-2649
Change-Id: Idb4e6d530075ab8c08c92e2e26d4de1bfd0459cf
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6')
12 files changed, 110 insertions, 33 deletions
diff --git a/sources/pyside6/PySide6/Qt3DRender/CMakeLists.txt b/sources/pyside6/PySide6/Qt3DRender/CMakeLists.txt index ef65a7be4..ad417ad54 100644 --- a/sources/pyside6/PySide6/Qt3DRender/CMakeLists.txt +++ b/sources/pyside6/PySide6/Qt3DRender/CMakeLists.txt @@ -3,6 +3,8 @@ project(Qt3DRender) +set(Qt3DRender_DROPPED_ENTRIES) + set(Qt3DRender_SRC ${Qt3DRender_GEN_DIR}/qsharedpointer_propertyreaderinterface_wrapper.cpp ${Qt3DRender_GEN_DIR}/qsharedpointer_qtextureimagedata_wrapper.cpp @@ -131,17 +133,19 @@ set(Qt3DRender_include_dirs ${pyside6_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} ${libpyside_SOURCE_DIR} ${QtCore_GEN_DIR} ${QtGui_GEN_DIR} - ${QtOpenGL_GEN_DIR} + ${Qt3DCore_GEN_DIR}) set(Qt3DRender_libraries pyside6 ${Qt${QT_MAJOR_VERSION}3DRender_LIBRARIES}) -set(Qt3DRender_deps Qt3DCore QtOpenGL) +set(Qt3DRender_deps) + +check_qt_opengl("3DRender" Qt3DRender_include_dirs Qt3DRender_deps + Qt3DRender_DROPPED_ENTRIES) create_pyside_module(NAME Qt3DRender INCLUDE_DIRS Qt3DRender_include_dirs @@ -149,4 +153,5 @@ create_pyside_module(NAME Qt3DRender DEPS Qt3DRender_deps TYPESYSTEM_PATH Qt3DRender_SOURCE_DIR SOURCES Qt3DRender_SRC - TYPESYSTEM_NAME ${Qt3DRender_BINARY_DIR}/typesystem_3drender.xml) + TYPESYSTEM_NAME ${Qt3DRender_BINARY_DIR}/typesystem_3drender.xml + DROPPED_ENTRIES Qt3DRender_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml b/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml index ea5fed6c4..6a49d1373 100644 --- a/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml +++ b/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml @@ -7,8 +7,11 @@ <typesystem package="PySide6.Qt3DRender" namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE"> <load-typesystem name="Qt3DCore/typesystem_3dcore.xml" generate="no"/> + <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> <!-- PYSIDE-2610: QOpenGLTexture's enums are used --> + <?if !no_QtOpenGL?> <load-typesystem name="QtOpenGL/typesystem_opengl.xml" generate="no"/> + <?endif?> <smart-pointer-type name="QSharedPointer" type="shared" getter="data" reset-method="reset" instantiations="Qt3DRender::PropertyReaderInterface=Qt3DRender::PropertyReaderInterfacePtr,Qt3DRender::QTextureImageData=Qt3DRender::QTextureImageDataPtr,Qt3DRender::QTextureImageDataGenerator=Qt3DRender::QTextureImageDataGeneratorPtr"/> diff --git a/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt b/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt index d8acb772f..59cef220b 100644 --- a/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtGraphs/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtGraphs) +set(QtGraphs_DROPPED_ENTRIES) + list(APPEND QtGraphs_src "${QtGraphs_SOURCE_DIR}/qtgraphs_helper.cpp") set(QtGraphs_SRC @@ -63,7 +65,6 @@ set(QtGraphs_include_dirs ${QtGraphs_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Widgets_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Quick_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}QuickWidgets_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Graphs_INCLUDE_DIRS} @@ -74,7 +75,6 @@ set(QtGraphs_include_dirs ${QtGraphs_SOURCE_DIR} ${QtGui_GEN_DIR} ${QtWidgets_GEN_DIR} ${QtQml_GEN_DIR} - ${QtOpenGL_GEN_DIR} ${QtQuick_GEN_DIR} ${QtQuickWidgets_GEN_DIR} ${QtQuick3D_GEN_DIR}) @@ -82,7 +82,10 @@ set(QtGraphs_include_dirs ${QtGraphs_SOURCE_DIR} set(QtGraphs_libraries pyside6 ${Qt${QT_MAJOR_VERSION}Graphs_LIBRARIES}) -set(QtGraphs_deps QtCore QtNetwork QtGui QtWidgets QtQml QtOpenGL QtQuick QtQuickWidgets QtQuick3D) +set(QtGraphs_deps QtCore QtNetwork QtGui QtWidgets QtQml QtQuick QtQuickWidgets QtQuick3D) + +check_qt_opengl("Graphs" QtGraphs_include_dirs QtGraphs_deps + QtGraphs_DROPPED_ENTRIES) create_pyside_module(NAME QtGraphs INCLUDE_DIRS QtGraphs_include_dirs @@ -90,7 +93,8 @@ create_pyside_module(NAME QtGraphs DEPS QtGraphs_deps TYPESYSTEM_PATH QtGraphs_SOURCE_DIR SOURCES QtGraphs_SRC - STATIC_SOURCES QtGraphs_src) + STATIC_SOURCES QtGraphs_src + DROPPED_ENTRIES QtGraphs_DROPPED_ENTRIES) install(FILES ${pyside6_SOURCE_DIR}/qtgraphs_helper.h DESTINATION include/PySide6/QtGraphs) diff --git a/sources/pyside6/PySide6/QtGui/CMakeLists.txt b/sources/pyside6/PySide6/QtGui/CMakeLists.txt index 641cef6a1..7cd7871f3 100644 --- a/sources/pyside6/PySide6/QtGui/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtGui/CMakeLists.txt @@ -25,8 +25,6 @@ ${QtGui_GEN_DIR}/qrhicommandbuffer_wrapper.cpp ${QtGui_GEN_DIR}/qrhicomputepipeline_wrapper.cpp ${QtGui_GEN_DIR}/qrhidepthstencilclearvalue_wrapper.cpp ${QtGui_GEN_DIR}/qrhidriverinfo_wrapper.cpp -${QtGui_GEN_DIR}/qrhigles2initparams_wrapper.cpp -${QtGui_GEN_DIR}/qrhigles2nativehandles_wrapper.cpp ${QtGui_GEN_DIR}/qrhigraphicspipeline_targetblend_wrapper.cpp ${QtGui_GEN_DIR}/qrhigraphicspipeline_wrapper.cpp ${QtGui_GEN_DIR}/qrhigraphicspipeline_stencilopstate_wrapper.cpp @@ -175,9 +173,6 @@ ${QtGui_GEN_DIR}/qmovie_wrapper.cpp ${QtGui_GEN_DIR}/qnativegestureevent_wrapper.cpp ${QtGui_GEN_DIR}/qnativeinterface_wrapper.cpp ${QtGui_GEN_DIR}/qoffscreensurface_wrapper.cpp -${QtGui_GEN_DIR}/qopenglcontextgroup_wrapper.cpp -${QtGui_GEN_DIR}/qopenglextrafunctions_wrapper.cpp -${QtGui_GEN_DIR}/qopenglfunctions_wrapper.cpp ${QtGui_GEN_DIR}/qpagedpaintdevice_wrapper.cpp ${QtGui_GEN_DIR}/qpagelayout_wrapper.cpp ${QtGui_GEN_DIR}/qpageranges_wrapper.cpp @@ -221,7 +216,6 @@ ${QtGui_GEN_DIR}/qsinglepointevent_wrapper.cpp ${QtGui_GEN_DIR}/qstandarditem_wrapper.cpp ${QtGui_GEN_DIR}/qstandarditemmodel_wrapper.cpp ${QtGui_GEN_DIR}/qstatustipevent_wrapper.cpp -${QtGui_GEN_DIR}/qopenglcontext_wrapper.cpp ${QtGui_GEN_DIR}/qaccessible_state_wrapper.cpp ${QtGui_GEN_DIR}/qaccessibleinterface_wrapper.cpp ${QtGui_GEN_DIR}/qscreen_wrapper.cpp @@ -298,6 +292,22 @@ elseif(WIN32) ${QtGui_GEN_DIR}/qnativeinterface_qwindowsscreen_wrapper.cpp) endif() +if("opengl" IN_LIST QtGui_enabled_features OR "opengles2" IN_LIST QtGui_enabled_features + OR "opengles3" IN_LIST QtGui_enabled_features) + list(APPEND QtGui_SRC + ${QtGui_GEN_DIR}/qopenglcontextgroup_wrapper.cpp + ${QtGui_GEN_DIR}/qopenglextrafunctions_wrapper.cpp + ${QtGui_GEN_DIR}/qopenglfunctions_wrapper.cpp + ${QtGui_GEN_DIR}/qopenglcontext_wrapper.cpp + ${QtGui_GEN_DIR}/qrhigles2initparams_wrapper.cpp + ${QtGui_GEN_DIR}/qrhigles2nativehandles_wrapper.cpp) +else() + list(APPEND QtGui_DROPPED_ENTRIES + QOpenGLContext QOpenGLContextGroup QOpenGLPaintDevice + QOpenGLExtraFunctions QOpenGLFunctions + QRhiGles2InitParams QRhiGles2NativeHandles) +endif() + set(QtGui_private_include_dirs ${Qt${QT_MAJOR_VERSION}Core_PRIVATE_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) diff --git a/sources/pyside6/PySide6/QtQuick/CMakeLists.txt b/sources/pyside6/PySide6/QtQuick/CMakeLists.txt index 8342d414c..a42b655db 100644 --- a/sources/pyside6/PySide6/QtQuick/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtQuick/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtQuick) +set(QtQuick_DROPPED_ENTRIES) + set(QtQuick_registerType "${QtQuick_SOURCE_DIR}/pysidequickregistertype.cpp") # Exclude sources that have clashing static helper functions named "renderstate_..." @@ -17,8 +19,6 @@ set_property(SOURCE ${QtQuick_SRC_UNITY_EXCLUDED_SRC} set(QtQuick_SRC ${QtQuick_SRC_UNITY_EXCLUDED_SRC} ${QtQuick_GEN_DIR}/qquickasyncimageprovider_wrapper.cpp -${QtQuick_GEN_DIR}/qquickframebufferobject_wrapper.cpp -${QtQuick_GEN_DIR}/qquickframebufferobject_renderer_wrapper.cpp ${QtQuick_GEN_DIR}/qquickgraphicsconfiguration_wrapper.cpp ${QtQuick_GEN_DIR}/qquickgraphicsdevice_wrapper.cpp ${QtQuick_GEN_DIR}/qquicktexturefactory_wrapper.cpp @@ -76,14 +76,12 @@ set(QtQuick_include_dirs ${QtQuick_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Core_PRIVATE_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_PRIVATE_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Quick_INCLUDE_DIRS} ${libpyside_SOURCE_DIR} ${QtGui_GEN_DIR} - ${QtOpenGL_GEN_DIR} ${QtCore_GEN_DIR} ${QtNetwork_GEN_DIR} ${QtQml_GEN_DIR} @@ -92,7 +90,18 @@ set(QtQuick_include_dirs ${QtQuick_SOURCE_DIR} set(QtQuick_libraries pyside6 pyside6qml ${Qt${QT_MAJOR_VERSION}Quick_LIBRARIES}) -set(QtQuick_deps QtGui QtOpenGL QtNetwork QtQml) +set(QtQuick_deps QtGui QtNetwork QtQml) + +check_qt_opengl("Quick" QtQuick_include_dirs QtQuick_deps + QtQuick_DROPPED_ENTRIES) + +if (Qt${QT_MAJOR_VERSION}OpenGL_FOUND) + list(APPEND QtQuick_SRC + ${QtQuick_GEN_DIR}/qquickframebufferobject_wrapper.cpp + ${QtQuick_GEN_DIR}/qquickframebufferobject_renderer_wrapper.cpp) +else() + list(APPEND QtQuick_DROPPED_ENTRIES QQuickFramebufferObject) +endif() create_pyside_module(NAME QtQuick INCLUDE_DIRS QtQuick_include_dirs @@ -100,4 +109,5 @@ create_pyside_module(NAME QtQuick DEPS QtQuick_deps TYPESYSTEM_PATH QtQuick_SOURCE_DIR SOURCES QtQuick_SRC - STATIC_SOURCES QtQuick_registerType) + STATIC_SOURCES QtQuick_registerType + DROPPED_ENTRIES QtQuick_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/QtQuick/pysidequickregistertype.cpp b/sources/pyside6/PySide6/QtQuick/pysidequickregistertype.cpp index 407162df6..f7749b4e7 100644 --- a/sources/pyside6/PySide6/QtQuick/pysidequickregistertype.cpp +++ b/sources/pyside6/PySide6/QtQuick/pysidequickregistertype.cpp @@ -9,7 +9,10 @@ #include <shiboken.h> #include <QtQuick/QQuickPaintedItem> -#include <QtQuick/QQuickFramebufferObject> + +#if QT_CONFIG(opengl) || QT_CONFIG(opengles2) || QT_CONFIG(opengles3) +# include <QtQuick/QQuickFramebufferObject> +#endif bool pyTypeObjectInheritsFromClass(PyTypeObject *pyObjType, const char *classPtrName) { @@ -51,8 +54,10 @@ bool quickRegisterType(PyObject *pyObj, QQmlPrivate::RegisterTypeAndRevisions *t return registerTypeIfInheritsFromClass<QQuickPaintedItem>("QQuickPaintedItem*", pyObjType, type) +#if QT_CONFIG(opengl) || QT_CONFIG(opengles2) || QT_CONFIG(opengles3) || registerTypeIfInheritsFromClass<QQuickFramebufferObject>("QQuickFramebufferObject*", pyObjType, type) +#endif || registerTypeIfInheritsFromClass<QQuickItem>("QQuickItem*", pyObjType, type); } @@ -62,7 +67,9 @@ void PySide::initQuickSupport(PyObject *module) Q_UNUSED(module); // We need to manually register a pointer version of these types in order for them to be used as property types. qRegisterMetaType<QQuickPaintedItem*>("QQuickPaintedItem*"); +#if QT_CONFIG(opengl) || QT_CONFIG(opengles2) || QT_CONFIG(opengles3) qRegisterMetaType<QQuickFramebufferObject*>("QQuickFramebufferObject*"); +#endif qRegisterMetaType<QQuickItem*>("QQuickItem*"); Qml::setQuickRegisterItemFunction(quickRegisterType); diff --git a/sources/pyside6/PySide6/QtQuick/typesystem_quick.xml b/sources/pyside6/PySide6/QtQuick/typesystem_quick.xml index ec8d28174..0bfb744c7 100644 --- a/sources/pyside6/PySide6/QtQuick/typesystem_quick.xml +++ b/sources/pyside6/PySide6/QtQuick/typesystem_quick.xml @@ -7,8 +7,11 @@ namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE"> <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/> + <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> <!-- QQuickFramebufferObject::Renderer needs QOpenGLFramebufferObject --> + <?if !no_QtOpenGL?> <load-typesystem name="QtOpenGL/typesystem_opengl.xml" generate="no"/> + <?endif?> <load-typesystem name="QtQml/typesystem_qml.xml" generate="no"/> <smart-pointer-type name="QSharedPointer" type="shared" getter="data" diff --git a/sources/pyside6/PySide6/QtQuick3D/CMakeLists.txt b/sources/pyside6/PySide6/QtQuick3D/CMakeLists.txt index 2d49c8d21..37f8ebfb1 100644 --- a/sources/pyside6/PySide6/QtQuick3D/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtQuick3D/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtQuick3D) +set (QtQuick3D_DROPPED_ENTRIES) + set(QtQuick3D_SRC ${QtQuick3D_GEN_DIR}/qquick3d_wrapper.cpp ${QtQuick3D_GEN_DIR}/qquick3dobject_wrapper.cpp @@ -22,7 +24,6 @@ set(QtQuick3D_include_dirs ${QtQuick3D_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Core_PRIVATE_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_PRIVATE_INCLUDE_DIRS} @@ -30,7 +31,6 @@ set(QtQuick3D_include_dirs ${QtQuick3D_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Quick3D_INCLUDE_DIRS} ${libpyside_SOURCE_DIR} ${QtGui_GEN_DIR} - ${QtOpenGL_GEN_DIR} ${QtCore_GEN_DIR} ${QtNetwork_GEN_DIR} ${QtQml_GEN_DIR} @@ -40,11 +40,15 @@ set(QtQuick3D_include_dirs ${QtQuick3D_SOURCE_DIR} set(QtQuick3D_libraries pyside6 ${Qt${QT_MAJOR_VERSION}Quick3D_LIBRARIES}) -set(QtQuick3D_deps QtGui QtOpenGL QtNetwork QtQml QtQuick) +set(QtQuick3D_deps QtGui QtNetwork QtQml QtQuick) + +check_qt_opengl("Quick3D" QtQuick3D_include_dirs QtQuick3D_deps + QtQuick3D_DROPPED_ENTRIES) create_pyside_module(NAME QtQuick3D INCLUDE_DIRS QtQuick3D_include_dirs LIBRARIES QtQuick3D_libraries DEPS QtQuick3D_deps TYPESYSTEM_PATH QtQuick3D_SOURCE_DIR - SOURCES QtQuick3D_SRC) + SOURCES QtQuick3D_SRC + DROPPED_ENTRIES QtQuick3D_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/QtQuickControls2/CMakeLists.txt b/sources/pyside6/PySide6/QtQuickControls2/CMakeLists.txt index 2cb95de98..72c046a57 100644 --- a/sources/pyside6/PySide6/QtQuickControls2/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtQuickControls2/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtQuickControls2) +set (QtQuickControls2_DROPPED_ENTRIES) + set(QtQuickControls2_SRC ${QtQuickControls2_GEN_DIR}/qquickstyle_wrapper.cpp # module is always needed @@ -14,14 +16,12 @@ set(QtQuickControls2_include_dirs ${QtQuickControls2_SOURCE_DIR} ${QtQml_SOURCE_DIR} ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Gui_INCLUDE_DIRS} - ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Qml_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}Quick_INCLUDE_DIRS} ${Qt${QT_MAJOR_VERSION}QuickControls2_INCLUDE_DIRS} ${libpyside_SOURCE_DIR} ${QtGui_GEN_DIR} - ${QtOpenGL_GEN_DIR} ${QtCore_GEN_DIR} ${QtNetwork_GEN_DIR} ${QtQml_GEN_DIR} @@ -31,11 +31,15 @@ set(QtQuickControls2_include_dirs ${QtQuickControls2_SOURCE_DIR} set(QtQuickControls2_libraries pyside6 ${Qt${QT_MAJOR_VERSION}QuickControls2_LIBRARIES}) -set(QtQuickControls2_deps QtGui QtOpenGL QtNetwork QtQml QtQuick) +set(QtQuickControls2_deps QtGui QtNetwork QtQml QtQuick) + +check_qt_opengl("QuickControls2" QtQuickControls2_include_dirs QtQuickControls2_deps + QtQuickControls2_DROPPED_ENTRIES) create_pyside_module(NAME QtQuickControls2 INCLUDE_DIRS QtQuickControls2_include_dirs LIBRARIES QtQuickControls2_libraries DEPS QtQuickControls2_deps TYPESYSTEM_PATH QtQuickControls2_SOURCE_DIR - SOURCES QtQuickControls2_SRC) + SOURCES QtQuickControls2_SRC + DROPPED_ENTRIES QtQuickControls2_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/QtQuickTest/CMakeLists.txt b/sources/pyside6/PySide6/QtQuickTest/CMakeLists.txt index 4a670d1db..8e3fb4d57 100644 --- a/sources/pyside6/PySide6/QtQuickTest/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtQuickTest/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtQuickTest) +set (QtQuickTest_DROPPED_ENTRIES) + set(QtQuickTest_SRC # module is always needed ${QtQuickTest_GEN_DIR}/qtquicktest_module_wrapper.cpp @@ -28,11 +30,15 @@ set(QtQuickTest_include_dirs ${QtQuickTest_SOURCE_DIR} set(QtQuickTest_libraries pyside6 ${Qt${QT_MAJOR_VERSION}QuickTest_LIBRARIES}) -set(QtQuickTest_deps QtGui QtOpenGL QtNetwork QtQml QtQuick) +set(QtQuickTest_deps QtGui QtNetwork QtQml QtQuick) + +check_qt_opengl("QuickTest" QtQuickTest_include_dirs QtQuickTest_deps + QtQuickTest_DROPPED_ENTRIES) create_pyside_module(NAME QtQuickTest INCLUDE_DIRS QtQuickTest_include_dirs LIBRARIES QtQuickTest_libraries DEPS QtQuickTest_deps TYPESYSTEM_PATH QtQuickTest_SOURCE_DIR - SOURCES QtQuickTest_SRC) + SOURCES QtQuickTest_SRC + DROPPED_ENTRIES QtQuickTest_DROPPED_ENTRIES) diff --git a/sources/pyside6/PySide6/QtQuickWidgets/CMakeLists.txt b/sources/pyside6/PySide6/QtQuickWidgets/CMakeLists.txt index 5afec6ee1..883010bee 100644 --- a/sources/pyside6/PySide6/QtQuickWidgets/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtQuickWidgets/CMakeLists.txt @@ -3,6 +3,8 @@ project(QtQuickWidgets) +set (QtQuickWidgets_DROPPED_ENTRIES) + set(QtQuickWidgets_SRC ${QtQuickWidgets_GEN_DIR}/qquickwidget_wrapper.cpp # module is always needed @@ -32,11 +34,15 @@ set(QtQuickWidgets_include_dirs ${QtQuickWidgets_SOURCE_DIR} set(QtQuickWidgets_libraries pyside6 ${Qt${QT_MAJOR_VERSION}QuickWidgets_LIBRARIES}) -set(QtQuickWidgets_deps QtGui QtOpenGL QtQml QtQuick QtWidgets QtNetwork) +set(QtQuickWidgets_deps QtGui QtQml QtQuick QtWidgets QtNetwork) + +check_qt_opengl("QuickWidgets" QtQuickWidgets_include_dirs QtQuickWidgets_deps + QtQuickWidgets_DROPPED_ENTRIES) create_pyside_module(NAME QtQuickWidgets INCLUDE_DIRS QtQuickWidgets_include_dirs LIBRARIES QtQuickWidgets_libraries DEPS QtQuickWidgets_deps TYPESYSTEM_PATH QtQuickWidgets_SOURCE_DIR - SOURCES QtQuickWidgets_SRC) + SOURCES QtQuickWidgets_SRC + DROPPED_ENTRIES QtQuickWidgets_DROPPED_ENTRIES) diff --git a/sources/pyside6/cmake/Macros/PySideModules.cmake b/sources/pyside6/cmake/Macros/PySideModules.cmake index bf6054a76..1e434f9f6 100644 --- a/sources/pyside6/cmake/Macros/PySideModules.cmake +++ b/sources/pyside6/cmake/Macros/PySideModules.cmake @@ -21,6 +21,21 @@ macro(unmake_path varname) string(REPLACE "${PATH_SEP}" ";" ${varname} "${ARGN}") endmacro() +# Check for presence of QtOpenGL and modify module variables +# accordingly +macro(check_qt_opengl module include_var deps_var dropped_entries_var) + if (Qt${QT_MAJOR_VERSION}OpenGL_FOUND) + message(STATUS "Qt${QT_MAJOR_VERSION}${module}: Building with OpenGL") + list(APPEND ${include_var} ${Qt${QT_MAJOR_VERSION}OpenGL_INCLUDE_DIRS} + ${QtOpenGL_GEN_DIR}) + list(APPEND ${deps_var} QtOpenGL) + else() + message(STATUS "Qt${QT_MAJOR_VERSION}${module}: Dropping OpenGL") + # This is a dummy entry creating a conditional typesystem keyword + list(APPEND ${dropped_entries_var} "QtOpenGL") + endif() +endmacro() + # set size optimization flags for pyside6 macro(append_size_optimization_flags _module_name) if(NOT QFP_NO_OVERRIDE_OPTIMIZATION_FLAGS) |