diff --git a/vcpkg/ports/qtquick3d/0001-devendor-meshoptimizer.patch b/vcpkg/ports/qtquick3d/0001-devendor-meshoptimizer.patch new file mode 100644 index 0000000000..094bed6f22 --- /dev/null +++ b/vcpkg/ports/qtquick3d/0001-devendor-meshoptimizer.patch @@ -0,0 +1,64 @@ +diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt +index 78ad8af..bee1ca6 100644 +--- a/src/utils/CMakeLists.txt ++++ b/src/utils/CMakeLists.txt +@@ -7,6 +7,8 @@ + ## Quick3DUtils Module: + ##################################################################### + ++qt_find_package(meshoptimizer PROVIDED_TARGETS meshoptimizer::meshoptimizer) ++ + qt_internal_add_module(Quick3DUtils + SOURCES + qqsbcollection.cpp qqsbcollection_p.h +@@ -26,49 +28,17 @@ qt_internal_add_module(Quick3DUtils + qquick3dprofiler_p.h + ../3rdparty/xatlas/xatlas.cpp ../3rdparty/xatlas/xatlas.h + qssglightmapuvgenerator.cpp qssglightmapuvgenerator_p.h +- ../3rdparty/meshoptimizer/src/allocator.cpp +- ../3rdparty/meshoptimizer/src/clusterizer.cpp +- ../3rdparty/meshoptimizer/src/indexcodec.cpp +- ../3rdparty/meshoptimizer/src/indexgenerator.cpp +- ../3rdparty/meshoptimizer/src/meshoptimizer.h +- ../3rdparty/meshoptimizer/src/overdrawanalyzer.cpp +- ../3rdparty/meshoptimizer/src/overdrawoptimizer.cpp +- ../3rdparty/meshoptimizer/src/simplifier.cpp +- ../3rdparty/meshoptimizer/src/spatialorder.cpp +- ../3rdparty/meshoptimizer/src/stripifier.cpp +- ../3rdparty/meshoptimizer/src/vcacheanalyzer.cpp +- ../3rdparty/meshoptimizer/src/vcacheoptimizer.cpp +- ../3rdparty/meshoptimizer/src/vertexcodec.cpp +- ../3rdparty/meshoptimizer/src/vertexfilter.cpp +- ../3rdparty/meshoptimizer/src/vfetchanalyzer.cpp +- ../3rdparty/meshoptimizer/src/vfetchoptimizer.cpp + NO_UNITY_BUILD_SOURCES + ../3rdparty/xatlas/xatlas.cpp ../3rdparty/xatlas/xatlas.h +- ../3rdparty/meshoptimizer/src/allocator.cpp +- ../3rdparty/meshoptimizer/src/clusterizer.cpp +- ../3rdparty/meshoptimizer/src/indexcodec.cpp +- ../3rdparty/meshoptimizer/src/indexgenerator.cpp +- ../3rdparty/meshoptimizer/src/meshoptimizer.h +- ../3rdparty/meshoptimizer/src/overdrawanalyzer.cpp +- ../3rdparty/meshoptimizer/src/overdrawoptimizer.cpp +- ../3rdparty/meshoptimizer/src/simplifier.cpp +- ../3rdparty/meshoptimizer/src/spatialorder.cpp +- ../3rdparty/meshoptimizer/src/stripifier.cpp +- ../3rdparty/meshoptimizer/src/vcacheanalyzer.cpp +- ../3rdparty/meshoptimizer/src/vcacheoptimizer.cpp +- ../3rdparty/meshoptimizer/src/vertexcodec.cpp +- ../3rdparty/meshoptimizer/src/vertexfilter.cpp +- ../3rdparty/meshoptimizer/src/vfetchanalyzer.cpp +- ../3rdparty/meshoptimizer/src/vfetchoptimizer.cpp + DEFINES + QT_BUILD_QUICK3DUTILS_LIB + INCLUDE_DIRECTORIES + ../3rdparty/xatlas +- ../3rdparty/meshoptimizer/src/ + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QuickPrivate ++ meshoptimizer::meshoptimizer + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui diff --git a/vcpkg/ports/qtquick3d/portfile.cmake b/vcpkg/ports/qtquick3d/portfile.cmake new file mode 100644 index 0000000000..817017816d --- /dev/null +++ b/vcpkg/ports/qtquick3d/portfile.cmake @@ -0,0 +1,31 @@ +set(SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase") +set(${PORT}_PATCHES 0001-devendor-meshoptimizer.patch) + +include("${SCRIPT_PATH}/qt_install_submodule.cmake") + +# General features: +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +FEATURES + "assimp" FEATURE_quick3d_assimp + #"assimp" CMAKE_REQUIRE_FIND_PACKAGE_WrapQuick3DAssimp +INVERTED_FEATURES + "assimp" CMAKE_DISABLE_FIND_PACKAGE_WrapQuick3DAssimp + ) + +if("assimp" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS -DINPUT_quick3d_assimp=system -DTEST_quick3d_assimp=ON -DHAVE_Assimp=ON) +else() + list(APPEND FEATURE_OPTIONS -DINPUT_quick3d_assimp=no) +endif() + +set(TOOL_NAMES balsam balsamui meshdebug shadergen instancer materialeditor shapegen) + +qt_install_submodule(PATCHES ${${PORT}_PATCHES} + TOOL_NAMES ${TOOL_NAMES} + CONFIGURE_OPTIONS + ${FEATURE_OPTIONS} + -DQT_FEATURE_quick3dxr_openxr=OFF + -DCMAKE_FIND_PACKAGE_TARGETS_GLOBAL=ON + CONFIGURE_OPTIONS_RELEASE + CONFIGURE_OPTIONS_DEBUG + ) diff --git a/vcpkg/ports/qtquick3d/vcpkg.json b/vcpkg/ports/qtquick3d/vcpkg.json new file mode 100644 index 0000000000..0374c1f6df --- /dev/null +++ b/vcpkg/ports/qtquick3d/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "qtquick3d", + "version": "6.8.0", + "port-version": 1, + "description": "Qt Quick 3D provides a high-level API for creating 3D content and 3D user interfaces based on Qt Quick.", + "homepage": "https://www.qt.io/", + "license": null, + "dependencies": [ + "meshoptimizer", + { + "name": "qtbase", + "default-features": false, + "features": [ + "gui" + ] + }, + "qtdeclarative", + { + "name": "qtquick3d", + "host": true, + "default-features": false + }, + "qtquicktimeline", + "qtshadertools" + ], + "default-features": [ + "default-features" + ], + "features": { + "assimp": { + "description": "assimp", + "dependencies": [ + "assimp" + ] + }, + "default-features": { + "description": "Platform-dependent default features" + } + } +}