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

Fix CMake CMP0135 configure warning #231

Merged
merged 2 commits into from
Aug 5, 2022
Merged

Conversation

aloisklink
Copy link
Contributor

On CMake v3.24.0, edgesec currently prints the following warning multiple times:

CMake Warning (dev) at /snap/cmake/1147/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.

By setting cmake_policy(VERSION 3.14.0...3.24.0), CMake will automatically enable all policies up to version v3.24.0, which hides these warnings.

We have to remove all the cmake_minimum_required... commands from the lib/ directory, since otherwise they overwrite the settings from the root CMakeLists.txt.

Remove the cmake_minimum_required() files from the `lib/`
directory.

Calling `cmake_minimum_required()` again resets all the
cmake_policy() commands we made earlier.
We're happy to use the new behaviour of all CMake policies until
CMake 3.24.0, especially if it hides all the ugly warnings when
configuring edgesec!
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #231 (79c8000) into main (c904824) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #231   +/-   ##
=======================================
  Coverage   45.56%   45.56%           
=======================================
  Files         108      108           
  Lines       14949    14949           
=======================================
  Hits         6811     6811           
  Misses       8138     8138           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mereacre mereacre merged commit 3926cae into main Aug 5, 2022
@mereacre mereacre deleted the build-fix-cmake-CMP0135-warning branch August 5, 2022 15:43
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

Successfully merging this pull request may close these issues.

2 participants