[llvm-dev] RFC: Move cmake shared files

John Brawn via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 17 04:13:38 PDT 2016


> 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>


More information about the llvm-dev mailing list