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.