Visitar URL original
README minimum CMake version is lower than CMakeLists.txt · Issue #7455 · libgit2/libgit2 · GitHub
Skip to content

README minimum CMake version is lower than CMakeLists.txt #7455

Open

Description

@dajiaohuang

At current main 42a89d7cc9374a19e72fa57011e5fe3a99c7b3bf, the detailed README build section says CMake2.8 or newer, but top-level CMakeLists.txt declares cmake_minimum_required(VERSION 3.5.1). This documentation mismatch can point readers at an unsupported minimum. Proposed correction: document3.5.1, matching the checked configuration.

Source-only reproduction: compare the CMake version sentence in README with the top-level minimum declaration at that commit. I have not run CMake2.8 or built/tested libgit2. The complete one-line documentation patch is below; no functional/API change or library-behavior validation is claimed. git diff --check passed. No dependency install, tests/build, CI/job, runtime/service or deployment ran, and no push/PR was created. This issue does not waive PR/build/test requirements.

I located this project through its read-only GitLab mirror, whose README explicitly directs Issues here; the mirror has received no writes. Current contribution guidance and relevant root GPLv2/linking-exception terms were read. This proposed documentation change is offered under the project terms; it contains no third-party code import. Bounded CMake/README title searches found historical adjacent reports, not this exact version-sentence proposal; no exhaustive issue-history claim.

diff --git a/README.md b/README.md
index b3d0e29..0239a56 100644
--- a/README.md
+++ b/README.md
@@ -222,7 +222,7 @@ Building
 
 `libgit2` builds cleanly on most platforms without any external
 dependencies as a requirement. `libgit2` is built using
-[CMake](<https://cmake.org/>) (version 2.8 or newer) on all platforms.
+[CMake](<https://cmake.org/>) (version 3.5.1 or newer) on all platforms.
 
 On most systems you can build the library using the following commands

Activity

  1. Esmail-sarhadi commented on Nov 2, 2026

    @Esmail-sarhadi

    Confirmed, and it is worse than a stale number: the two files disagree by a whole major version.

    • CMakeLists.txt:7 - cmake_minimum_required(VERSION 3.5.1)
    • README.md:225 - "CMake (version 2.8 or newer) on all platforms."

    A user who follows the README on a machine with CMake 2.8 or 3.0 gets the configure step failing with the "CMake 3.5.1 or higher is required" error, which reads like a broken checkout rather than a documentation problem. On 3.5.1 to 3.9 there is a second effect worth knowing about: those versions are below the policy level where cmake_minimum_required is treated as a minimum rather than a policy setting, so the build can configure and then behave differently from what CI tests.

    The fix is one line in the README, and while it is being touched it is worth deciding which number the project actually supports: 3.5.1 is what the file says, but if CI runs a much newer CMake (the GitHub runners ship 3.2x), then 3.5.1 is only nominally supported and the README could say so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions