mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Rename DOCUMENTATION option to WITH_DOCS in CMakeLists.txt

Open ssam18 opened this issue 1 month ago • 1 comments

Problem

Fixes #3381

The CMakeLists.txt used DOCUMENTATION as the option name, while the README.md and config.mk consistently use WITH_DOCS. This naming inconsistency made it confusing for users who want to disable documentation building.

Current State

  • CMakeLists.txt: Uses DOCUMENTATION option
  • config.mk: Uses WITH_DOCS variable
  • README.md: Documents make WITH_DOCS=no

Solution

Rename the CMake option from DOCUMENTATION to WITH_DOCS to match the Makefile convention and maintain consistency across the build system.

Changes

  1. Renamed option(DOCUMENTATION ...) to option(WITH_DOCS ...)
  2. Updated all references: if (DOCUMENTATION)if (WITH_DOCS)
  3. Maintains consistency with other CMake options (WITH_CLIENTS, WITH_BROKER, WITH_APPS, WITH_PLUGINS)

Usage

Before:

cmake -DDOCUMENTATION=OFF ..

After:

cmake -DWITH_DOCS=OFF ..

Backward Compatibility

This is a breaking change for users who explicitly set -DDOCUMENTATION=OFF in their CMake commands. However:

  • The option was undocumented in README (which only mentions WITH_DOCS)
  • It aligns with the established WITH_* naming convention
  • Makes the build system more intuitive and consistent

Testing

  • Verified the diff shows correct renaming
  • Option maintains the same default value (ON)
  • No functional changes to the build process

ssam18 avatar Dec 02 '25 03:12 ssam18

@jacmet @xrmx @onip @ncopa Please get a chance to review this small PR.

SamareshSingh avatar Dec 04 '25 16:12 SamareshSingh