Merge pull request #7095 from giogadi/cmake-full-install-name-staging

Make cmake install shared libraries with full install names by default

+9
+9
pkgs/development/tools/build-managers/cmake/setup-hook.sh
··· 36 36 cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-g++ -DCMAKE_C_COMPILER=$crossConfig-gcc $cmakeFlags" 37 37 fi 38 38 39 + # This installs shared libraries with a fully-specified install 40 + # name. By default, cmake installs shared libraries with just the 41 + # basename as the install name, which means that, on Darwin, they 42 + # can only be found by an executable at runtime if the shared 43 + # libraries are in a system path or in the same directory as the 44 + # executable. This flag makes the shared library accessible from its 45 + # nix/store directory. 46 + cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags" 47 + 39 48 # Avoid cmake resetting the rpath of binaries, on make install 40 49 # And build always Release, to ensure optimisation flags 41 50 cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"