Skip to content

Remove the description for versions before cmake 3.5 #541

@halajohn

Description

@halajohn

Because cmake 4.0.0 has removed compatibility with versions of cmake before 3.5, using logic like the following will result in a cmake error:

cmake_minimum_required(VERSION 3.1)
  CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 has been removed from CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.

    Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


     Called from: [1]	/home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clingo-sys-0.7.2/clingo/CMakeLists.txt

  thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cmake-0.1.54/src/lib.rs:1119:5:

  command did not execute successfully, got: exit status: 1

Currently, for example, the GitHub workflow environments have gradually introduced cmake 4.0.0. This causes compilation errors for clingo and a series of wrappers built on it (such as clingo-sys, clingo-rs, etc.). For instance, in clingo-sys, clingo is compiled using the following method:

let dst = Config::new("clingo")
    .very_verbose(true)
    .define("CLINGO_BUILD_SHARED", "OFF")
    .define("CLINGO_BUILD_STATIC", "ON")
    .define("CLINGO_MANAGE_RPATH", "OFF")
    .define("CLINGO_BUILD_WITH_PYTHON", "OFF")
    .define("CLINGO_BUILD_WITH_LUA", "OFF")
    .define("CLINGO_INSTALL_LIB", "ON")
    .define("CLINGO_BUILD_APPS", "OFF")
    .define("CLASP_BUILD_APP", "OFF")
    .build();

Even setting environment variables (for example, using export CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5") does not affect this behavior.

Could you modify all instances of cmake_minimum_required(VERSION x.x) in clingo so that x.x is at least greater than 3.5? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions