Add find_package option for reporting the version found
When we initially configure using CMake, we get some messages about some of our find_package()
instructions, e.g.:
-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "12.0.140", minimum required is "10.1")
or:
-- Found Python: /usr/bin/python3.11 (found version "3.11.2") found components: Interpreter
but for other packages we find_package - nothing is printed by default. The packages printing such messages probably have a custom, albeit CMake-distributed, Find script.
I would like to be able to have find_package()
of some of my packages report which package version was found. Naturally, I could do it manually, myself, after the find_package call - but I believe this is sufficiently useful and common to have it as a find_package option.
What is to be reported:
- Minimal option: The found version
- Maximal option: Found version, minimum required version, location (a-la-CUDAToolkit)
Choosing something between the minimum and the maximum would be bike-shedding, so not getting into that right now.
Notes:
- This is not intended for debugging, but for routine use.
- It's a bit weird that printing this information is not the default behavior, considering we have a QUIET option... perhaps I should have described this fact as a bug rather than a feature request.