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 #230

Merged
merged 3 commits into from
Jun 26, 2023
Merged

Cmake warning #230

merged 3 commits into from
Jun 26, 2023

Conversation

graeme-a-stewart
Copy link
Member

Update the extraction policy for the GTest externals - this is because of recent CMake changes in 3.24 (see https://cmake.org/cmake/help/latest/policy/CMP0135.html#policy:CMP0135).

I also took the opportunity to update our submodules to the latest releases:

  • nlohmman-json: 3.11.2
  • spdlog: 1.11.0

N.B. I experimented with various options re. CMake policies, but the long and short of it is that adapting to this change means we need to have a minimum CMake version of 3.24, which is pretty new (August 2022). @amete - what's being used in ATLAS these days?

Probably it's also time for a minor release.

Closes #229

For modern CMake use the new CMP0135 policy, i.e.,
use timestamps from extraction of tarballs

Bump internal submodules to latest releases:
nlohmman-json: 3.11.2
spdlog: 1.11.0
Now to 3.24, which is where the option to handle
extract time timestamps was introduced
@graeme-a-stewart graeme-a-stewart requested a review from amete June 23, 2023 13:06
@graeme-a-stewart
Copy link
Member Author

Oh err missus.... we need to update to this newer CMake on our CI platforms!

Address the timestamp issue differently, using a query for the
policy, which indicates a newer cmake, and only setting the policy
if that test passes

This allows us to be still compaible with much older cmake versions
@graeme-a-stewart
Copy link
Member Author

graeme-a-stewart commented Jun 23, 2023

Oh, I found out how to do this and stay compatible with older CMakes:

if (POLICY CMP0135)
  cmake_policy(SET CMP0135 NEW)
endif (POLICY CMP0135)

Panic over! The new version fixes things for new CMakes and doesn't break things for older versions.

@amete
Copy link
Collaborator

amete commented Jun 26, 2023

We're using CMake version 3.24.3 in release 23.0/master these days @graeme-a-stewart. It's great that we can support both old and new CMake versions w/ the POLICY trick. Approving this PR 👍

@amete amete merged commit d6a97cc into main Jun 26, 2023
@graeme-a-stewart graeme-a-stewart deleted the cmake-warning branch June 27, 2023 08:58
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.

Need to update CMake policy
2 participants