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: fix warning with external googletest #2980

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

rouault
Copy link
Member

@rouault rouault commented Dec 10, 2021

Recent CMake versions throw the following warning when building
googletest 1.8.1. Bumping to 1.11.0 that has a minimum version of 2.8.12
fixes that

 CMake Deprecation Warning at build/googletest-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

@rouault
Copy link
Member Author

rouault commented Dec 10, 2021

bummer: gcc 4.8 is not able to build googletest 1.11.0

@kbevers
Copy link
Member

kbevers commented Dec 10, 2021

bummer: gcc 4.8 is not able to build googletest 1.11.0

Maybe it's time to move on? Most recent GCC 4.8 version is from 2015

Recent CMake versions throw the following warning when building
googletest 1.8.1. Bumping to 1.11.0 that has a minimum version of 2.8.12
fixes that
```
 CMake Deprecation Warning at build/googletest-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
```
@rouault
Copy link
Member Author

rouault commented Dec 10, 2021

Maybe it's time to move on? Most recent GCC 4.8 version is from 2015

yeah, I'm changing this conf to use the default GCC 5.4 from Ubuntu 16.04

@mwtoews
Copy link
Member

mwtoews commented Dec 10, 2021

If we really want to keep GCC 4.8 in the mix, another strategy is to edit test/googletest/CMakeLists.txt.in with something like:

if(CMAKE_VERSION VERSION_LESS 3.???)
  # GCC 4.8 compat
else()
  # more recent compat
endif()

@rouault
Copy link
Member Author

rouault commented Dec 10, 2021

If we really want to keep GCC 4.8 in the mix, another strategy is to edit test/googletest/CMakeLists.txt.in with something like:

I don't have any personal interest in such old versions.
I don't see the relationship between the CMake version and the GCC version. A system with gcc 4.8 has normally not CMake >= 3.9 by default, so they should use a backport version, which can be anything >= 3.9

Copy link
Member

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, lets move on from GCC 4.8. While interesting to see it raise different issues in the CI compared to newer compilers, it's really a bit of a distraction. GCC 5.4 is from 2016, so a bit newer. Nevertheless, I'd like to see the CMake warning go away with the upgraded googletest.

@rouault rouault added this to the 9.0.0 milestone Dec 20, 2021
@rouault rouault merged commit dad309d into OSGeo:master Dec 20, 2021
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.

None yet

3 participants