diff options
-rw-r--r-- | config_help.txt | 5 | ||||
-rw-r--r-- | examples/examples.pro | 5 | ||||
-rw-r--r-- | src/core/configure.json | 51 | ||||
-rw-r--r-- | src/core/qt3dcore_global.h | 1 | ||||
-rw-r--r-- | src/quick3d/imports/scene3d/importsscene3d.pro | 5 | ||||
-rw-r--r-- | src/quick3d/imports/scene3d/scene3ditem.cpp | 20 | ||||
-rw-r--r-- | src/render/backend/render-backend.pri | 1 | ||||
-rw-r--r-- | src/src.pro | 73 | ||||
-rw-r--r-- | tests/auto/auto.pro | 15 | ||||
-rw-r--r-- | tests/auto/render/render.pro | 31 | ||||
-rw-r--r-- | tests/benchmarks/benchmarks.pro | 7 | ||||
-rw-r--r-- | tests/tests.pro | 9 |
12 files changed, 172 insertions, 51 deletions
diff --git a/config_help.txt b/config_help.txt index 8aeed3007..8f055023d 100644 --- a/config_help.txt +++ b/config_help.txt @@ -3,3 +3,8 @@ Qt3D options: -assimp .............. Select used assimp library [system/qt/no] -qt3d-profile-jobs ... Enable jobs profiling [no] -qt3d-profile-gl ..... Enable OpenGL profiling [no] + -qt3d-render ......... Enable the Qt3D Render aspect [yes] + -qt3d-input .......... Enable the Qt3D Input aspect [yes] + -qt3d-logic .......... Enable the Qt3D Logic aspect [yes] + -qt3d-extras ......... Enable the Qt3D Extras aspect [yes] + -qt3d-animation....... Enable the Qt3D Animation aspect [yes] diff --git a/examples/examples.pro b/examples/examples.pro index 6d61af094..6a3c01d76 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,5 @@ TEMPLATE = subdirs -SUBDIRS += qt3d + +QT_FOR_CONFIG += 3dcore + +qtConfig(qt3d-extras): SUBDIRS += qt3d diff --git a/src/core/configure.json b/src/core/configure.json index 47a726d82..1640ec25a 100644 --- a/src/core/configure.json +++ b/src/core/configure.json @@ -6,7 +6,12 @@ "options": { "assimp": { "type": "enum", "values": [ "qt", "system", "no" ] }, "qt3d-profile-jobs": "boolean", - "qt3d-profile-gl": "boolean" + "qt3d-profile-gl": "boolean", + "qt3d-render": "boolean", + "qt3d-input": "boolean", + "qt3d-logic": "boolean", + "qt3d-extras": "boolean", + "qt3d-animation": "boolean" } }, @@ -48,6 +53,38 @@ "privateFeature", { "type": "define", "name": "QT3D_OPENGL_RUN_STATS", "value": 1 } ] + }, + "qt3d-render": { + "label": "Render aspect", + "purpose": "Use the 3D Render Aspect library", + "section": "Aspects", + "output": [ "publicFeature" ] + }, + "qt3d-input": { + "label": "Input aspect", + "purpose": "Use the 3D Input Aspect library", + "section": "Aspects", + "output": [ "publicFeature" ] + }, + "qt3d-logic": { + "label": "Logic aspect", + "purpose": "Use the 3D Logic Aspect library", + "section": "Aspects", + "output": [ "publicFeature" ] + }, + "qt3d-extras": { + "label": "Extras aspect", + "purpose": "Use the 3D Extra library", + "section": "Aspects", + "condition": "features.qt3d-render && features.qt3d-input && features.qt3d-logic", + "output": [ "publicFeature" ] + }, + "qt3d-animation": { + "label": "Animation aspect", + "purpose": "Use the 3D Animation Aspect library", + "section": "Aspects", + "condition": "features.qt3d-render", + "output": [ "publicFeature" ] } }, @@ -61,7 +98,17 @@ "assimp", "system-assimp", "qt3d-profile-jobs", - "qt3d-profile-gl" + "qt3d-profile-gl", + { + "section": "Aspects", + "entries": [ + "qt3d-render", + "qt3d-input", + "qt3d-logic", + "qt3d-animation", + "qt3d-extras" + ] + } ] } ] diff --git a/src/core/qt3dcore_global.h b/src/core/qt3dcore_global.h index e11907cad..a449a2e52 100644 --- a/src/core/qt3dcore_global.h +++ b/src/core/qt3dcore_global.h @@ -41,6 +41,7 @@ #define QT3DCORE_GLOBAL_H #include <QtCore/qglobal.h> +#include <Qt3DCore/qt3dcore-config.h> QT_BEGIN_NAMESPACE diff --git a/src/quick3d/imports/scene3d/importsscene3d.pro b/src/quick3d/imports/scene3d/importsscene3d.pro index 7aa3317c9..e41dc8c84 100644 --- a/src/quick3d/imports/scene3d/importsscene3d.pro +++ b/src/quick3d/imports/scene3d/importsscene3d.pro @@ -3,7 +3,10 @@ TARGET = qtquickscene3dplugin TARGETPATH = QtQuick/Scene3D IMPORT_VERSION = 2.0 -QT += qml quick 3dcore 3drender 3drender-private 3dinput 3dlogic +QT += qml quick 3dcore 3drender 3drender-private + +qtConfig(qt3d-input): QT += 3dinput +qtConfig(qt3d-logic): QT += 3dlogic # Qt3D is free of Q_FOREACH - make sure it stays that way: DEFINES += QT_NO_FOREACH diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index c31f4aa97..4371e60b4 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -39,11 +39,19 @@ #include "scene3ditem_p.h" -#include <Qt3DCore/QAspectEngine> +#include <Qt3DCore/qt3dcore_global.h> #include <Qt3DCore/qentity.h> +#include <Qt3DCore/QAspectEngine> + +#if QT_CONFIG(qt3d_input) #include <Qt3DInput/QInputAspect> #include <Qt3DInput/qinputsettings.h> +#endif + +#if QT_CONFIG(qt3d_logic) #include <Qt3DLogic/qlogicaspect.h> +#endif + #include <Qt3DRender/QRenderAspect> #include <Qt3DRender/qcamera.h> #include <Qt3DRender/qrendersurfaceselector.h> @@ -121,12 +129,20 @@ void Scene3DItem::setAspects(const QStringList &aspects) if (aspect == QLatin1String("render")) // This one is hardwired anyway continue; if (aspect == QLatin1String("input")) { +#if QT_CONFIG(qt3d_input) m_aspectEngine->registerAspect(new Qt3DInput::QInputAspect); continue; +#else + qFatal("Scene3D requested the Qt 3D input aspect but Qt 3D wasn't configured to build the Qt 3D Input aspect"); +#endif } if (aspect == QLatin1String("logic")) { +#if QT_CONFIG(qt3d_logic) m_aspectEngine->registerAspect(new Qt3DLogic::QLogicAspect); continue; +#else + qFatal("Scene3D requested the Qt 3D input aspect but Qt 3D wasn't configured to build the Qt 3D Input aspect"); +#endif } m_aspectEngine->registerAspect(aspect); } @@ -189,6 +205,7 @@ void Scene3DItem::applyRootEntityChange() } } +#if QT_CONFIG(qt3d_input) // Set ourselves up as a source of input events for the input aspect Qt3DInput::QInputSettings *inputSettings = m_entity->findChild<Qt3DInput::QInputSettings *>(); if (inputSettings) { @@ -196,6 +213,7 @@ void Scene3DItem::applyRootEntityChange() } else { qCDebug(Scene3D) << "No Input Settings found, keyboard and mouse events won't be handled"; } +#endif } } diff --git a/src/render/backend/render-backend.pri b/src/render/backend/render-backend.pri index 3d174f637..74bd5022b 100644 --- a/src/render/backend/render-backend.pri +++ b/src/render/backend/render-backend.pri @@ -81,7 +81,6 @@ SOURCES += \ $$PWD/segmentsvisitor.cpp \ $$PWD/commandthread.cpp -include($$OUT_PWD/../core/qt3dcore-config.pri) QT_FOR_CONFIG += 3dcore-private qtConfig(qt3d-profile-jobs): { HEADERS += $$PWD/commandexecuter_p.h diff --git a/src/src.pro b/src/src.pro index 46c205849..83a95e2bf 100644 --- a/src/src.pro +++ b/src/src.pro @@ -13,7 +13,7 @@ src_logic.depends = src_core src_input.subdir = $$PWD/input src_input.target = sub-input -src_input.depends = src_render +src_input.depends = src_core src_animation.subdir = $$PWD/animation src_animation.target = sub-animation @@ -27,7 +27,7 @@ qtHaveModule(quick) { # Quick3D libs src_quick3d_core.subdir = $$PWD/quick3d/quick3d src_quick3d_core.target = sub-quick3d-core - src_quick3d_core.depends = src_core src_input + src_quick3d_core.depends = src_core src_quick3d_render.subdir = $$PWD/quick3d/quick3drender src_quick3d_render.target = sub-quick3d-render @@ -60,7 +60,7 @@ qtHaveModule(quick) { src_quick3d_imports_scene3d.file = $$PWD/quick3d/imports/scene3d/importsscene3d.pro src_quick3d_imports_scene3d.target = sub-quick3d-imports-scene3d - src_quick3d_imports_scene3d.depends = src_quick3d_render src_input + src_quick3d_imports_scene3d.depends = src_quick3d_render src_quick3d_imports_input.file = $$PWD/quick3d/imports/input/importsinput.pro src_quick3d_imports_input.target = sub-quick3d-imports-input @@ -102,30 +102,57 @@ qtHaveModule(quick) { SUBDIRS += \ src_core \ - src_render \ - src_logic \ - src_input \ src_animation \ - src_extras \ - src_plugins_sceneparsers \ - src_plugins_geometryloaders \ doc +QT_FOR_CONFIG += 3dcore +include($$OUT_PWD/core/qt3dcore-config.pri) + +qtConfig(qt3d-input): SUBDIRS += src_input +qtConfig(qt3d-logic): SUBDIRS += src_logic +qtConfig(qt3d-render): SUBDIRS += src_render +qtConfig(qt3d-animation): SUBDIRS += src_animation +qtConfig(qt3d-extras) { + SUBDIRS += \ + src_extras \ + src_plugins_sceneparsers \ + src_plugins_geometryloaders +} + qtHaveModule(quick) { SUBDIRS += \ src_quick3d_core \ - src_quick3d_core_imports \ - src_quick3d_render \ - src_quick3d_input \ - src_quick3d_animation \ - src_quick3d_extras \ - src_quick3d_imports_render \ - src_quick3d_imports_scene3d \ - src_quick3d_imports_input \ - src_quick3d_imports_logic \ - src_quick3d_imports_animation \ - src_quick3d_imports_extras \ - src_plugins_render \ - src_quick3d_scene2d \ - src_quick3d_imports_scene2d + src_quick3d_core_imports + + qtConfig(qt3d-input) { + SUBDIRS += \ + src_quick3d_input \ + src_quick3d_imports_input + } + qtConfig(qt3d-logic): SUBDIRS += src_quick3d_imports_logic + qtConfig(qt3d-render) { + SUBDIRS += \ + src_quick3d_render \ + src_quick3d_imports_render \ + src_quick3d_imports_scene3d + + qtConfig(qt3d-input) { + src_quick3d_imports_scene3d.depends += src_input + SUBDIRS += \ + src_quick3d_scene2d \ + src_quick3d_imports_scene2d + } + qtConfig(qt3d-logic): src_quick3d_imports_scene3d.depends += src_logic + } + qtConfig(qt3d-animation) { + SUBDIRS += \ + src_quick3d_animation \ + src_quick3d_imports_animation + } + qtConfig(qt3d-extras) { + SUBDIRS += \ + src_quick3d_extras \ + src_quick3d_imports_extras \ + src_plugins_render + } } diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 7cbb53089..39631ef99 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -2,11 +2,14 @@ TEMPLATE = subdirs SUBDIRS = \ core \ - render \ - quick3d \ - cmake \ - input \ - animation \ - extras + cmake installed_cmake.depends = cmake +QT_FOR_CONFIG += 3dcore + +qtConfig(qt3d-render): SUBDIRS += render +qtConfig(qt3d-input): SUBDIRS += input +qtConfig(qt3d-animation): SUBDIRS += animation +qtConfig(qt3d-extras): SUBDIRS += extras +qtConfig(qt3d-render):qtConfig(qt3d-input): SUBDIRS += quick3d + diff --git a/tests/auto/render/render.pro b/tests/auto/render/render.pro index e5637df75..40e2262c2 100644 --- a/tests/auto/render/render.pro +++ b/tests/auto/render/render.pro @@ -14,7 +14,6 @@ qtConfig(private_tests) { material \ vsyncframeadvanceservice \ meshfunctors \ - qmaterial \ qattribute \ qbuffer \ qgeometry \ @@ -24,7 +23,6 @@ qtConfig(private_tests) { buffer \ attribute \ geometry \ - geometryloaders \ geometryrenderer \ raycasting \ qcameraselector \ @@ -44,11 +42,8 @@ qtConfig(private_tests) { framegraphnode \ qobjectpicker \ objectpicker \ - picking \ # qboundingvolumedebug \ # boundingvolumedebug \ - boundingsphere \ - qdefaultmeshes \ trianglesextractor \ triangleboundingvolume \ ddstextures \ @@ -70,8 +65,6 @@ qtConfig(private_tests) { graphicshelpergl3_3 \ graphicshelpergl3_2 \ graphicshelpergl2 \ - gltfplugins \ - pickboundingvolumejob \ sendrendercapturejob \ textures \ qparameter \ @@ -81,8 +74,6 @@ qtConfig(private_tests) { qabstracttexture \ qabstracttextureimage \ qrendersettings \ - updatemeshtrianglelistjob \ - updateshaderdatatransformjob \ texturedatamanager \ rendertarget \ transform \ @@ -107,11 +98,29 @@ qtConfig(private_tests) { memorybarrier \ qshaderprogram \ qshaderprogrambuilder \ - qscene2d \ - scene2d \ coordinatereader \ framegraphvisitor \ renderer + QT_FOR_CONFIG = 3dcore-private + qtConfig(qt3d-extras) { + SUBDIRS += \ + qmaterial \ + geometryloaders \ + picking \ + boundingsphere \ + qdefaultmeshes \ + pickboundingvolumejob \ + gltfplugins \ + updatemeshtrianglelistjob \ + updateshaderdatatransformjob + } + + qtConfig(qt3d-input) { + SUBDIRS += \ + qscene2d \ + scene2d + } + !macos: SUBDIRS += graphicshelpergl4 } diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index bcaf713c6..7dfc52eec 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -1,4 +1,7 @@ TEMPLATE = subdirs SUBDIRS = \ - core \ - render + core + +QT_FOR_CONFIG += 3dcore + +qtConfig(qt3d-render): SUBDIRS += render diff --git a/tests/tests.pro b/tests/tests.pro index 2ab283fc2..157bdcea5 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,8 +1,11 @@ TEMPLATE = subdirs -!package: SUBDIRS += \ - auto \ - manual +QT_FOR_CONFIG += 3dcore + +!package { + SUBDIRS += auto + qtConfig(qt3d-extras): SUBDIRS += manual +} # Benchmarks make sense in release mode only. # Disable them for code coverage. |