find_package(<pkgName> CONFIG REQUIRED) can return without finding a package?
We observed a situation with CMake 3.24.3 where calling:
find_package(<pkgName> CONFIG REQUIRED)
message("<pkgName>_DIR='${<pkgName>_DIR}")
printed:
<pkgName>_DIR=''
without raising an error.
I have not been able to reproduce this myself on my machine but I observed this occurring on another developer's machine.
This happened when executing:
(and we added the message()
statement in a local copy of the file).