The cmake files generated when building LLVM (including LLVMConfig.cmake) are to support cmake's find_package() [1] function. In the build dir the generated files are placed in <build-dir>/share/llvm/cmake. After install, in <prefix>/lib/llvm/share/llvm/cmake. CMake is not able to find them without a hint. CMake searches these paths on Unix: - <prefix>/lib/llvm/cmake - <prefix>/share/llvm/cmake Some distributions try to workaround the problem by moving contents of /lib/llvm/share/llvm/cmake to /share/llvm/cmake, but usually that breaks the configuration included in LLVMConfig.cmake because of some hardcoded paths there. I propose to move the generated files to <build-dir>/cmake and install them to <prefix>/lib/llvm/cmake. This should also help on Windows, where CMake searches in <prefix>/llvm/cmake. - Paweł [1] https://cmake.org/cmake/help/v3.0/command/find_package.html -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160817/704afc39/attachment.html>
> In the build dir the generated files are placed in <build-dir>/share/llvm/cmake. After install, in <prefix>/lib/llvm/share/llvm/cmake.Really? According to this commit ------------------------------------------------------------------------ r259821 | olesalscheider | 2016-02-04 20:08:19 +0000 (Thu, 04 Feb 2016) | 8 lines Install cmake files to lib/cmake/llvm This is the right location for platform-specific files. On some distributions (e. g. Exherbo), a package can be installed for several architectures in parallel, but the architecture-independent files are shared. Therefore, we must not install architecture-dependent files (like the CMake config and export files) to share/. ------------------------------------------------------------------------ They’re built to <build-dir>/lib/cmake/llvm and installed to <prefix>/lib/cmake/llvm, which matches <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U) in the cmake documentation you’ve linked. (Note: this is trunk, I haven’t looked at 3.x or 4.0) John From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Pawel Bylica via llvm-dev Sent: 17 August 2016 11:13 To: llvm-dev; Sylvestre Ledru Subject: [llvm-dev] RFC: Move cmake shared files The cmake files generated when building LLVM (including LLVMConfig.cmake) are to support cmake's find_package() [1] function. In the build dir the generated files are placed in <build-dir>/share/llvm/cmake. After install, in <prefix>/lib/llvm/share/llvm/cmake. CMake is not able to find them without a hint. CMake searches these paths on Unix: - <prefix>/lib/llvm/cmake - <prefix>/share/llvm/cmake Some distributions try to workaround the problem by moving contents of /lib/llvm/share/llvm/cmake to /share/llvm/cmake, but usually that breaks the configuration included in LLVMConfig.cmake because of some hardcoded paths there. I propose to move the generated files to <build-dir>/cmake and install them to <prefix>/lib/llvm/cmake. This should also help on Windows, where CMake searches in <prefix>/llvm/cmake. - Paweł [1] https://cmake.org/cmake/help/v3.0/command/find_package.html -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160817/1bc7e971/attachment.html>
On Wed, Aug 17, 2016 at 1:13 PM John Brawn <John.Brawn at arm.com> wrote:> > In the build dir the generated files are placed in > <build-dir>/share/llvm/cmake. After install, in > <prefix>/lib/llvm/share/llvm/cmake. > > > > Really? According to this commit > > > > ------------------------------------------------------------------------ > > r259821 | olesalscheider | 2016-02-04 20:08:19 +0000 (Thu, 04 Feb 2016) | > 8 lines > > > > Install cmake files to lib/cmake/llvm > > > > This is the right location for platform-specific files. > > > > On some distributions (e. g. Exherbo), a package can be installed for > several > > architectures in parallel, but the architecture-independent files are > shared. > > Therefore, we must not install architecture-dependent files (like the CMake > > config and export files) to share/. > > ------------------------------------------------------------------------ > > > > They’re built to <build-dir>/lib/cmake/llvm and installed to > <prefix>/lib/cmake/llvm, which matches > > <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U) > > in the cmake documentation you’ve linked. > > > > (Note: this is trunk, I haven’t looked at 3.x or 4.0) >This is good news. But is this layout suitable to support multiple versions of LLVM? Libs are installed to <prefix>/lib, but packages changes that to <prefix>/lib/llvm-X.Y. Should the packaging change also <prefix>/lib/cmake/llvm to <prefix/lib/cmake/llvm-X.Y. If yes, this might cause the same issues with hardcoded/incorrectly assumed paths as I'm having now.> > *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *Pawel > Bylica via llvm-dev > *Sent:* 17 August 2016 11:13 > *To:* llvm-dev; Sylvestre Ledru > *Subject:* [llvm-dev] RFC: Move cmake shared files > > > > The cmake files generated when building LLVM (including LLVMConfig.cmake) > are to support cmake's find_package() [1] function. > > > > In the build dir the generated files are placed in > <build-dir>/share/llvm/cmake. After install, in > <prefix>/lib/llvm/share/llvm/cmake. > > > > CMake is not able to find them without a hint. CMake searches these paths > on Unix: > > - <prefix>/lib/llvm/cmake > > - <prefix>/share/llvm/cmake > > > > Some distributions try to workaround the problem by moving contents of > /lib/llvm/share/llvm/cmake to /share/llvm/cmake, but usually that breaks > the configuration included in LLVMConfig.cmake because of some hardcoded > paths there. > > > > I propose to move the generated files to <build-dir>/cmake and install > them to <prefix>/lib/llvm/cmake. > > > > This should also help on Windows, where CMake searches in > <prefix>/llvm/cmake. > > > > - Paweł > > > > [1] https://cmake.org/cmake/help/v3.0/command/find_package.html >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160817/cd23eaef/attachment-0001.html>