I did this for two reasons:
- Using the CMake packages simplifies building LLDB Standalone. This is for two reasons: 1) We were doing a decent amount of work that is already done in the LLVMConfig.cmake that we want to import, 2) We had to do some manual work to call llvm-config, parse its output, and populate variables that the build system uses.
- As far as I understand, using llvm-config makes it difficult if not impossible to cross-compile LLDB standalone.
Apparently the idea of using LLVM_BUILD_MAIN_INCLUDE_DIR is plain wrong here. The old code used the equivalent of LLVM_INCLUDE_DIR (i.e. the include dir of *installed* LLVM) and I think the new code should use the same. Given how long the old code was there, I suppose there shouldn't be any use case broken by using that directory.