-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
Opening issue as approved by maintainer on #2089 .
Current state
CMake variable GOOGLETEST_VERSION is fixed, not computed from non-CMake-specific information, see line below:
Line 4 in ea43be9
| set(GOOGLETEST_VERSION 1.9.0) |
Consequence
As a consequence, whenever googletest version number changes, this file has to be changed, too.
This would be a non-issue if that line was the "single, unambiguous, authoritative representation".
The reality is googletest maintainers do not use CMake at all. CMake is completely community supported for googletest. bazel is main release mechanism.
If we do nothing about this, people building using CMake will get wrong version information as soon as version changes, until someone fixes that each time.
Solution
It is possible in CMake to automatically compute the value of the variable, based on git describe.
For example, this answer: https://stackoverflow.com/a/38836941
Best solutions are those that keep maximum portability (avoid making unnecessary assumptions about CMake-time platform).
As a side note, it would be best to add some comments on top of the CMakeLists.txt to make clear that bazel is primary build system and CMake is community supported.
I may do this some time in the future, but don't hold your breath. Anyone can offer a PR, too.