When supplying a package with <Project>Config.cmake files, it is required to also supply a <Project>ConfigVersion.cmake file which defines compatibility with version numbers. If these files aren't distributed then supplying a version number will fail. But on the other hand, not supplying a version number can result in the wrong package being selected. For example, because the base LLVM package does supply LLVMConfigVersion.cmake, the following can occur:
find_package(LLVM 11.0 REQUIRED) # Succeeds find_package(LLD 11.0) # Fails because there's no version config find_package(LLD) # Succeeds, finds version 10.
This patch would not affect any existing uses of the CMake build/packages because the ConfigVersion.cmake file is ignored when no version is given and the status quo is that supplying a version fails.
This patch also fixes a bug I opened a year ago here: https://bugs.llvm.org/show_bug.cgi?id=45027
Instead of including this multiple times, please add it to AddLLVM.cmake. That file is used in project top-level builds too and it already contains other includes needed in the build. It is installed, but only for the purpose of building other parts of LLVM, so it's not a concern for third parties either (It is not included by LLVMConfig.cmake).