[Bug]: Use of `ExactVersion` with CMake `write_basic_package_version_file` is unfortunate 😞
- Lenguaje dominante
- C++
- Estrellas
- 18.1k
- Forks
- 3.2k
- Merge medio
- 20 h 36 min
- PR fusionados (30 d)
- 1
Descripción
### Describe the issue
Hi!
It has come to my attention that use of `ExactVersion` at…
https://github.com/abseil/abseil-cpp/blob/f751e6186da331d7a712256d4cdc5e812cdb60b7/CMakeLists.txt#L204-L207
…makes use of `find_package(absl 20240722.0 CONFIG REQUIRED)` in dependent build systems officially incompatible with any other major version like `20250512.1` when compiling against it and use of `find_package(absl CONFIG REQUIRED)` works fine in contrast against the very same system Abseil. That's rather unfortunate, e.g. because [it forbids Google Protobuf from requiring Abseil >=20240722.0 at build time](https://github.com/protocolbuffers/protobuf/issues/24374#issuecomment-3529189705) my conventional means. Is there a chance this could be re-considered in Abseil? Could you elaborate on the rationale behind this approach?
Thanks and best, Sebastian
CC @mkruskal-google
### Steps to reproduce the problem
```console
# cat CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(absl_dep_check)
find_package(absl 20240722.0 CONFIG REQUIRED)
# cmake .
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a configuration file for package "absl" that is compatible
with requested version "20240722.0".
^^^^^^^
The following configuration files were considered but not accepted:
/usr/lib64/cmake/absl/abslConfig.cmake, version: 20250512
^^^^^
-- Configuring incomplete, errors occurred!
```
### What version of Abseil are you using?
Git `master` (commit f751e6186da331d7a712256d4cdc5e812cdb60b7)
### What operating system and version are you using?
(Linux)
### What compiler and version are you using?
(GCC 15 + Clang 21)
### What build system are you using?
CMake
### Additional context
_No response_
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.