git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #52859 from jtojnar/cmake-gid

cmake: use multiple outputs for GNUInstallDirs

commit883a1dffcfe4734a3b13a034869e94edafc90322 authorworldofpeace <worldofpeace@protonmail.ch> dateThu 25 Jul 2019, 16:05 (7 years ago) parent6d6e218c0d2f92
1 file changed+13−1
pkgs/development/tools/build-managers/cmake/setup-hook.sh+13−1
pkgs/development/tools/build-managers/cmake/setup-hook.sh+13−1
@@ -68,8 +68,20 @@ cmakeConfigurePhase() {
6868 # executable. This flag makes the shared library accessible from its
6969 # nix/store directory.
7070 cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib $cmakeFlags"
71+
72+ # This ensures correct paths with multiple output derivations
73+ # It requires the project to use variables from GNUInstallDirs module
74+ # https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
75+ cmakeFlags="-DCMAKE_INSTALL_BINDIR=${!outputBin}/bin $cmakeFlags"
76+ cmakeFlags="-DCMAKE_INSTALL_SBINDIR=${!outputBin}/sbin $cmakeFlags"
77+ cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputInclude}/include $cmakeFlags"
78+ cmakeFlags="-DCMAKE_INSTALL_OLDINCLUDEDIR=${!outputInclude}/include $cmakeFlags"
79+ cmakeFlags="-DCMAKE_INSTALL_MANDIR=${!outputMan}/share/man $cmakeFlags"
80+ cmakeFlags="-DCMAKE_INSTALL_INFODIR=${!outputInfo}/share/info $cmakeFlags"
81+ cmakeFlags="-DCMAKE_INSTALL_DOCDIR=${!outputDoc}/share/doc/${shareDocName} $cmakeFlags"
7182 cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
72− cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
83+ cmakeFlags="-DCMAKE_INSTALL_LIBEXECDIR=${!outputLib}/libexec $cmakeFlags"
84+ cmakeFlags="-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale $cmakeFlags"
7385
7486 # Don’t build tests when doCheck = false
7587 if [ -z "$doCheck" ]; then