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

cmake: Warning on init #854

Open
jenisys opened this issue May 20, 2024 · 0 comments
Open

cmake: Warning on init #854

jenisys opened this issue May 20, 2024 · 0 comments

Comments

@jenisys
Copy link

jenisys commented May 20, 2024

Description

Doctest CMakeLists.txt contains the following line:

cmake_minimum_required(VERSION 3.0)

When doctest is used in another CMake project as test framework, the following CMake warning is shown:

CMake Deprecation Warning at build/_deps/doctest-src/CMakeLists.txt:1 (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.

This warning can be removed by adapting the line using the solution below:

# -- SOLUTION NEEDS: CMAKE_MIN_VERSION >= 3.5
cmake_minimum_required(VERSION 3.5)

AFFECTED FILES IN REPOSITORY:

  • CMakeLists.txt
  • examples/installed_doctest_cmake/executable/CMakeLists.txt
  • examples/installed_doctest_cmake/dll/CMakeLists.txt
  • scripts/how_stuff_works/CMakeLists.txt

Steps to reproduce

$ pip install cmake 
$ cmake --version
cmake version 3.29.3

$ cmake -S . -B build
...
CMake Deprecation Warning at build/_deps/doctest-src/CMakeLists.txt:1 (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.
...

Extra information

  • doctest version: v2.4.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant