[CMake] Add missing find_package for LibEdit
authorPetr Hosek <phosek@google.com>
Fri, 21 Apr 2023 22:34:11 +0000 (22:34 +0000)
committerPetr Hosek <phosek@google.com>
Fri, 21 Apr 2023 22:34:11 +0000 (22:34 +0000)
commit7d89e6c1c0a01c959beddab643e39d2bc4c2c97d
tree06d572dcecc8970451ec3c0c77f9bcdca73d4335
parent7d3f341e2d7531e586a1800d55b5486c066088b8
[CMake] Add missing find_package for LibEdit

After building and installing LLVM with LibEdit as a dependency, it is
necessary to find it again when LLVM is consumed by another CMake
project, otherwise CMake will report an error about a missing target.

Note that the FindLibEdit.cmake file is in the "LLVM Common CMake
Utils" directory, outside of the LLVM sub-project source directory, so
the installed LLVMConfig.cmake relies on the user having installed the
LLVM common CMake modules or make available their own Find module.

Also note that the controlling HAVE_LIBEDIT CMake variable in
LLVMConfig.cmake.in has a different naming convention compared to
other similar variables like 'LLVM_ENABLE_TERMINFO'. Refactoring this
name would involve touching additional files and should be a follow-up
commit.

Patch By: ekilmer

Differential Revision: https://reviews.llvm.org/D147153
llvm/cmake/config-ix.cmake
llvm/cmake/modules/LLVMConfig.cmake.in