cmake: set LIBDIR and INCLUDEDIR for multiple outputs

This commit is contained in:
Thomas Tuegel 2016-04-19 20:36:03 -05:00
parent d088e0621e
commit 491f7f017c
2 changed files with 2 additions and 5 deletions

View File

@ -16,11 +16,6 @@ stdenv.mkDerivation {
propagatedBuildInputs = [ polkit glib qtbase ]; propagatedBuildInputs = [ polkit glib qtbase ];
preConfigure = ''
cmakeFlags+=" -DCMAKE_INSTALL_LIBDIR=''${!outputLib}/lib"
cmakeFlags+=" -DCMAKE_INSTALL_INCLUDEDIR=''${!outputDev}/include"
'';
postFixup = '' postFixup = ''
# Fix library location in CMake module # Fix library location in CMake module
sed -i "$dev/lib/cmake/PolkitQt5-1/PolkitQt5-1Config.cmake" \ sed -i "$dev/lib/cmake/PolkitQt5-1/PolkitQt5-1Config.cmake" \

View File

@ -44,6 +44,8 @@ cmakeConfigurePhase() {
# executable. This flag makes the shared library accessible from its # executable. This flag makes the shared library accessible from its
# nix/store directory. # nix/store directory.
cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags" cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
# Avoid cmake resetting the rpath of binaries, on make install # Avoid cmake resetting the rpath of binaries, on make install
# And build always Release, to ensure optimisation flags # And build always Release, to ensure optimisation flags