Add a version to non-LLVM cmake package so that users needing an exact
version match can use the version parameter to find_package. Also adjust
the find_package(LLVM) to use an exact version match as well.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I thought we had this already. The amount of boiler plate required repeated in each component is depressing, but I wouldn't be surprised if it's really needed
I could configure the LLVMVersion file in llvm/cmake/module directly but I would need to refer to it from all those modified CMakeLists.txt and it didn't feel very clean either.
As mentioned, the duplication is annoying but I suspect is the least bad way to do it.
clang/cmake/modules/ClangConfig.cmake.in | ||
---|---|---|
6 | I think instead of @LLVM_VERSION@ it should be ${LLVM_VERSION} since @LLVM_VERSION@ can be something like 16.0.0gitfce7a7aa when LLVM_VERSION_SUFFIX is set and that value is incorrect according to cmake find_package:
This error message is produced by cmake when configuring standalone build of lldb:
|
clang/cmake/modules/ClangConfig.cmake.in | ||
---|---|---|
6 | Doh, yeah it was meant to use the variable above. I used PACKAGE_VERSION initially which is why I had those @@. Weird that it worked on my test despite using a git build. I've reverted and will upload a new version here. |
I think instead of @LLVM_VERSION@ it should be ${LLVM_VERSION} since @LLVM_VERSION@ can be something like 16.0.0gitfce7a7aa when LLVM_VERSION_SUFFIX is set and that value is incorrect according to cmake find_package:
This error message is produced by cmake when configuring standalone build of lldb: