Skip to content

CMake: auto-enable CGAL_DEV_MODE when building from CGAL source tree#9472

Open
shresthbhargava wants to merge 1 commit into
CGAL:mainfrom
shresthbhargava:fix/cgal-dev-mode-auto-detect
Open

CMake: auto-enable CGAL_DEV_MODE when building from CGAL source tree#9472
shresthbhargava wants to merge 1 commit into
CGAL:mainfrom
shresthbhargava:fix/cgal-dev-mode-auto-detect

Conversation

@shresthbhargava

Copy link
Copy Markdown

Fixes #9441.

Problem

CGAL_DEV_MODE had no option() declaration in CGALConfig.cmake.
Developers building from the CGAL source tree had to manually set
CGAL_DEV_MODE=ON in their shell profile — easy to miss for new contributors.

Fix

  • After cgal_detect_branch_build(), compute _cgal_dev_mode_default:
    • ON if BRANCH_BUILD is true
    • $ENV{CGAL_DEV_MODE} if the env var is set
    • OFF otherwise (external/installed CGAL users unaffected)
  • Declare option(CGAL_DEV_MODE ...) with that default
  • Emit message(WARNING) when auto-enabled so developers know
    it's active and can disable it with -DCGAL_DEV_MODE=OFF

Testing

  • Configure from CGAL root → WARNING shown, CGAL_DEV_MODE=ON
  • Configure with -DCGAL_DEV_MODE=OFF → no warning, flag OFF ✓
  • External project using installed CGAL → flag OFF by default ✓

Fixes CGAL#9441.

When cgal_detect_branch_build() returns TRUE, CGAL_DEV_MODE now
defaults to ON instead of requiring developers to set the environment
variable manually. Falls back to $ENV{CGAL_DEV_MODE} if set,
otherwise OFF for external users.

A CMake WARNING is printed when auto-enabled so users know the
setting is active and how to disable it with -DCGAL_DEV_MODE=OFF.
@afabri

afabri commented May 11, 2026

Copy link
Copy Markdown
Member

The message should mention https://github.com/CGAL/cgal/wiki/CGAL_DEV_MODE

@shresthbhargava

Copy link
Copy Markdown
Author

Updated the warning message to include the wiki link

@MaelRL MaelRL added this to the 6.3-beta milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CGAL_DEV_MODE should be ON by default some use cases

3 participants