awslabs / aws-crt-cpp

C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Apache License 2.0
73 stars 64 forks source link

CMake Deprecation Warnings #606

Open nabelekt opened 4 months ago

nabelekt commented 4 months ago

Describe the bug

I am using v0.26.4 and getting many warnings like this when building:

CMake Deprecation Warning at libraries/third_party/aws-crt-cpp/crt/aws-c-sdkutils/CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

The fix is given the last two lines there.

Expected Behavior

No warnings when building

Current Behavior

See above

Reproduction Steps

Build with the library

Possible Solution

No response

Additional Information/Context

No response

aws-crt-cpp version used

0.26.4

Compiler and version used

gcc version 13.2.0 (Ubuntu 13.2.0-4ubuntu3)

Operating System and version

Ubuntu 23.10

nabelekt commented 4 months ago

For what it's worth, https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-linux.html specifies the CMake minimum versions as 3.13.

DmitriyMusatkin commented 4 months ago

Note that CRT and SDK are separate projects, with CRT being a dependency of CPP SDK. And while CPP SDK has a min cmake version 3.13, CRT supports much older cmake versions.

We do want to increase our min version in the future, but as of right now we dont have a concrete date on when that might happen

graebm commented 4 months ago

It's possible to shut these warnings up by stating that your project is known to be compatible with later versions, like: cmake_minimum_required(VERSION 3.1...3.29)

unfortunately, this isn't supported until cmake 3.12, so the code would need to be like:

if (CMAKE_VERSION VERSION_LESS "3.12")
    cmake_minimum_required(VERSION 3.1)
else ()
    cmake_minimum_required(VERSION 3.1...3.29)
endif ()