[PATCH] D117973: [cmake] Support custom package install paths

John Ericson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 22 16:30:58 PST 2022


Ericson2314 created this revision.
Ericson2314 added reviewers: compnerd, phosek, beanz, sterni.
Herald added subscribers: sdasgup3, wenzhicui, wrengr, Chia-hungDuan, dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, mgorny.
Herald added a reviewer: bollu.
Herald added a reviewer: sscalpone.
Herald added a project: Flang.
Ericson2314 requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, stephenneuendorffer, nicolasvasilache, jdoerfert.
Herald added projects: clang, MLIR, LLVM.

Firstly, we we make an additional GNUInstallDirs-style variable. With
NixOS, for example, this is crucial as we want those to go in
`${dev}/lib/cmake` not `${out}/lib/cmake` as would a cmake subdir of the
"regular" libdir.

Secondly, we make *Config.cmake robust to absolute package install
paths. We for NixOS will in fact be passing them absolute paths to make
the `${dev}` vs `${out}` distinction mentioned above, and the
GNUInstallDirs-style variables are suposed to support absolute paths in
general so it's good practice besides the NixOS use-case.

Thirdly, we make `${project}_INSTALL_PACKAGE_DIR` CACHE PATHs like other
install dirs are.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117973

Files:
  clang/cmake/modules/CMakeLists.txt
  cmake/Modules/FindPrefixFromConfig.cmake
  cmake/Modules/GNUInstallPackageDir.cmake
  flang/cmake/modules/CMakeLists.txt
  lld/cmake/modules/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/CMakeLists.txt
  mlir/cmake/modules/CMakeLists.txt
  polly/cmake/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117973.402270.patch
Type: text/x-patch
Size: 16518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220123/b47f16f1/attachment-0001.bin>


More information about the llvm-commits mailing list