]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cmake: add cmake 4 support 65916/head
authorEdwin Rodriguez <edwin.rodriguez1@ibm.com>
Thu, 2 Oct 2025 14:46:51 +0000 (10:46 -0400)
committerEdwin Rodriguez <edwin.rodriguez1@ibm.com>
Mon, 20 Oct 2025 21:02:57 +0000 (17:02 -0400)
commit802195ec97f3a4cbee5ab9d5f7a72bcedf55a79d
treeadacac1f8f0fcbdad911d2f4246629d98f436a7a
parente288069c4f67a04d985a811d785bfe4f59596bbc
cmake: add cmake 4 support

This change improves the CMAKE variable detection logic in do_cmake.sh
to allow users to override the CMAKE binary used for building.

Changes:
- Add conditional check to only set CMAKE if not already set
- Add detection for cmake version 4.x and later (prioritized)
- Maintain backward compatibility with cmake3 fallback
- Allow users to specify custom CMAKE path via environment variable
- Pass CMAKE_POLICY_VERSION_MINIMUM if set to submodule build steps for
    older modules

This enables users to use a specific cmake binary by setting the CMAKE
environment variable before running the script:
  CMAKE=/custom/path/to/cmake ./do_cmake.sh

Additionally, the script now automatically detects and uses cmake 4.x+
when available, falling back to cmake3 or cmake as needed. This supports
building Ceph with newer cmake versions while maintaining compatibility
with existing build environments.

Fixes: https://tracker.ceph.com/issues/73523
Signed-off-by: Edwin Rodriguez <edwin.rodriguez1@ibm.com>
cmake/modules/BuildOpentelemetry.cmake
do_cmake.sh