[cgal] add eigen3/tbb/ceres/openmesh features, split qt-svg out of qt - #53396
Draft
N'yoma Diamond (nyoma-diamond) wants to merge 2 commits into
Draft
[cgal] add eigen3/tbb/ceres/openmesh features, split qt-svg out of qt#53396N'yoma Diamond (nyoma-diamond) wants to merge 2 commits into
N'yoma Diamond (nyoma-diamond) wants to merge 2 commits into
Conversation
N'yoma Diamond (nyoma-diamond)
marked this pull request as draft
August 13, 2026 11:23
N'yoma Diamond (nyoma-diamond)
force-pushed
the
cgal-optional-features
branch
from
August 13, 2026 11:32
ed63a09 to
22d93c1
Compare
N'yoma Diamond (nyoma-diamond)
marked this pull request as ready for review
August 13, 2026 13:03
Adds standalone opt-in features for optional third-party libraries CGAL supports, following the same find_package()/include()/target_link_libraries() pattern CGAL's own upstream examples use for each: - eigen3: Eigen3 linear algebra support (was previously only obtainable via the "qt" feature, which had nothing to do with Eigen3) - qt: disentangled from Eigen3; also drops the unused "qtdeclarative" dependency, which CGAL's Qt6 GraphicsView support never references - qt-svg: SVG icon support for the "qt" feature, split out since CGAL treats Qt6::Svg as an OPTIONAL_COMPONENTS, not a hard requirement of Qt support - tbb: Intel TBB support for CGAL's parallel algorithms - ceres: Ceres Solver support, used in mesh processing optimization - openmesh: OpenMesh support, usable as an alternative mesh data structure Fixes microsoft#48042 Fixes microsoft#10736 usage documents the exact CMake incantation each feature requires, since none of CGAL's optional support targets are linked automatically -- this mirrors CGAL's own per-target opt-in design across all of its third-party integrations, not just the ones touched here.
qtbase:arm64-linux=fail and qtsvg:arm64-linux=cascade already confirm this cascade path; qt-svg depends on both cgal[qt] and qtsvg directly.
N'yoma Diamond (nyoma-diamond)
force-pushed
the
cgal-optional-features
branch
from
August 13, 2026 19:46
1509c83 to
db59987
Compare
Billy O'Neal (BillyONeal)
left a comment
Member
There was a problem hiding this comment.
GPT 5.6 Sol reports:
- The
licenseexpression omitsMIT, although the installedCGAL/Classification/ETHZheaders are covered by upstream's exact MIT text inInstallation/LICENSE.RFL.
Would you consider nyoma-diamond#2 ?
Billy O'Neal (BillyONeal)
marked this pull request as draft
August 13, 2026 22:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds standalone opt-in features for several of CGAL's optional third-party libraries, and fixes the existing
qtfeature to only depend on what CGAL's Qt integration actually requires.Closes #48042 (requests an
eigen3feature and points outqtis overspecified).Closes #10736 (clarifies intent/expectation to properly enable CGAL's TBB support).
New/changed features:
eigen3eigen3qt, which has nothing to do with Eigen3qtqtbase[widgets]eigen3(see above) andqtdeclarative(never referenced by CGAL's Qt6 GraphicsView. Verified by readingCGAL_SetupCGAL_Qt6Dependencies.cmake, which only ever touchesOpenGL/OpenGLWidgets/Widgets, plus optionalSvg)qt-svgqtsvg, requiresqtSvgviaOPTIONAL_COMPONENTS, not as a hard requirement of Qt supporttbbtbbCGAL::TBB_supportfor CGAL's parallel algorithmsceresceresCGAL::Ceres_support, used in mesh-processing optimization (e.g. angle/area smoothing)openmeshopenmeshCGAL::OpenMesh_support, an alternative mesh data structure usable with CGAL's BGL-based algorithmsusagenow documents the exact CMake needed per feature, since CGAL never links any of these automatically. Every one of CGAL's optional third-party integrations is opt-in per-target by design, matching what CGAL's own example CMakeLists.txt files do.Design choices / caveats
Per-target opt-in, not auto-detection. [CGAL] Enable CGAL_LINKED_WITH_TBB #10736's original ask was for the port to auto-detect TBB and enable it if present. This wasn't implemented as literally requested: It would violate the maintainer guide's "ports must not be path dependent" rule. A port's installed output/behavior must not silently change based on what else happens to be installed. Explicit per-feature opt-in (as done here) keeps
cgal's behavior deterministic regardless of install order, and matches CGAL's own upstream design: Every one of its roughly 15CGAL_*_support.cmakemodules (Eigen3, TBB, Ceres, OpenMesh, OpenCV, METIS, and GLPK, among others) is opt-in per-target via an explicitinclude()+target_link_libraries(), not auto-enabled.find_package(... CONFIG REQUIRED)inusage, notQUIET. CGAL's own examples useQUIET(noREQUIRED) because they need to configure across arbitrary environments where the optional dependency may or may not exist at all. That's the wrong pattern forusage's audience: If you've enabledcgal[tbb](etc.) via vcpkg, the dependency is guaranteed to be installed, so a silentfind_packagefailure only masks real misconfiguration (wrong triplet, broken toolchain file).CONFIGalso avoids a real hazard, beyond simple correctness. CGAL bundles its own legacyFindTBB.cmake(a rawTBB_ROOT-based module predating oneTBB) onCMAKE_MODULE_PATH, and CMake tries Module mode before Config mode by default. WithoutCONFIG, a machine with strayTBB_ROOT/TBB_ARCH_PLATFORMenv vars from an unrelated install could silently hijack discovery away from vcpkg's package. Verified all five (Eigen3Config.cmake,TBBConfig.cmake,CeresConfig.cmake,OpenMeshConfig.cmake, andQt6Config.cmake) are actually installed by vcpkg's respective ports.CGAL_setup_CGAL_Qt6_dependencies()alone is not sufficient. It linksCGAL::CGAL,CGAL::Qt6_moc_and_resources, andQt6::OpenGLWidgetswith theINTERFACEkeyword, which (per CMake semantics) only propagates to further consumers of your target: It doesn't reach an executable's own link line.usagedocuments linking those three explicitly as well, confirmed by hittingLNK2001 unresolved external symbol ...GraphicsItem::metaObjectwithout it.openmesh,ceres,tbb,eigen3, andqt/qt-svgwere each individually built and run against real upstream CGAL examples (Polygon_mesh_processing/examplesfor TBB/Ceres,BGL/examples/BGL_OpenMeshfor OpenMesh,Solver_interface/examplesfor Eigen3, and aTriangulationGraphicsItem/QGraphicsViewprogram for Qt), confirming actual execution rather than a successful configure step alone. This caught both theINTERFACE-linkage issue above and confirmed vcpkg'scerespackage sets the legacy uppercaseCERES_FOUNDvariable thatCGAL_Ceres_support.cmakechecks for.METIS/GLPK/OSQP/OpenCV/ITK were investigated but not added in this PR. They follow the identical simple pattern, but I didn't build/run/verify them the same way, and some (ITK, OpenCV) are heavy dependencies. Happy to follow up separately if there's interest.
Checklist
cgal[qt]:arm64-linux=cascadeentry is unrelated to this change and left as-is.cgal[qt-svg]:arm64-linux=cascade.qtbase:arm64-linux=failandqtsvg:arm64-linux=cascadealready confirm the same cascade path, andqt-svgdepends on bothcgal[qt]andqtsvgdirectly../vcpkg x-add-version --alland committing the result.