Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt uses comparisons in if() functions that are unsupported by some of CMake versions specified in cmake_minimum_required #10128

Closed
nick-telia opened this issue Dec 21, 2022 · 1 comment
Labels

Comments

@nick-telia
Copy link

I did this

I tried running CMake version 3.5.1 to build the latest Curl release (7.87.0).

Since CMakeLists.txt contains the line cmake_minimum_required(VERSION 3.2...3.16 FATAL_ERROR) I didn't expect the command to fail with my version of CMake. Unfortunately the usage of GREATER_EQUAL and GREATER_EQUAL that became available only in CMake 3.7 led to the following error:

CMake Error at CMakeLists.txt:1093 (if):
  if given arguments:

    "NOT" "MSVC" "OR" "(" "MSVC_VERSION" "GREATER_EQUAL" "1900" ")"

  Unknown arguments specified


   Called from: [1]	/curl-7.87.0/CMakeLists.txt
-- Configuring incomplete, errors occurred!

Somewhat related: #9237

I expected the following

Successful run of CMake or a warning about incompatible version.

curl/libcurl version

7.87.0

operating system

I was running a container built from Ubuntu 16.04.5 LTS.

@bagder bagder added the cmake label Dec 22, 2022
@bagder
Copy link
Member

bagder commented Dec 26, 2022

If I knew cmake, I would move that version number check into the C code that needs to be built and linked to check for the symbol to avoid having cmake do it. But as I don't know how to, I propose we instead raise the lowest accepted cmake version to 3.7. Released in November 2016.

Anyone objects?

bagder added a commit that referenced this issue Dec 26, 2022
Because this is the cmake version that introduced
GREATER_EQUAL. Released in November 2016.

Reported-by: nick-telia on github
Fixes #10128
@bagder bagder closed this as completed in dfbe035 Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants