-
Notifications
You must be signed in to change notification settings - Fork 7
Use FetchContent for CGAL instead of find_package #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CGAL 5.x is header-only, so we can use FetchContent to download the headers directly instead of requiring a system installation. Changes: - Download CGAL 5.6.1 via FetchContent (header-only, no CMake build) - Require Boost headers (CGAL dependency) - Simplify stl_wall_cgal linking to just include dirs + Boost::headers This removes the need for users to install CGAL separately.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
CGAL uses GMP for exact arithmetic in ray-triangle intersection. Added find_library for GMP and linked it to stl_wall_cgal target.
When CGAL is enabled but GMP is not installed on the system, automatically download and build GMP 6.3.0 via ExternalProject. This allows CGAL support on systems without libgmp-dev.
User description
CGAL 5.x is header-only, so we can use FetchContent to download the headers directly instead of requiring a system installation.
Changes:
This removes the need for users to install CGAL separately.
PR Type
Enhancement
Description
Replace CGAL system dependency with FetchContent download
Simplify CGAL integration for header-only library usage
Add Boost headers as explicit CGAL dependency requirement
Remove CGAL CMake build configuration and targets
Diagram Walkthrough
File Walkthrough
CMakeLists.txt
Switch CGAL to FetchContent with Boost dependencyCMakeLists.txt
find_package(CGAL)with FetchContent to download CGAL 5.6.1headers
find_package(Boost REQUIRED)as CGAL dependencyCGAL_INCLUDE_DIRvariable pointing to fetched CGAL include pathCMakeLists.txt
Update stl_wall_cgal linking for header-only CGALsrc/CMakeLists.txt
target_link_libraries(stl_wall_cgal PUBLIC CGAL::CGAL)targetlinking
CGAL::CGAL_Coretarget linkingtarget_include_directories()withCGAL_INCLUDE_DIRfor header-onlyusage
Boost::headersinstead of CGAL CMake targets