···3636 cmakeFlags="-DCMAKE_CXX_COMPILER=$crossConfig-g++ -DCMAKE_C_COMPILER=$crossConfig-gcc $cmakeFlags"
3737 fi
38383939+ # This installs shared libraries with a fully-specified install
4040+ # name. By default, cmake installs shared libraries with just the
4141+ # basename as the install name, which means that, on Darwin, they
4242+ # can only be found by an executable at runtime if the shared
4343+ # libraries are in a system path or in the same directory as the
4444+ # executable. This flag makes the shared library accessible from its
4545+ # nix/store directory.
4646+ cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags"
4747+3948 # Avoid cmake resetting the rpath of binaries, on make install
4049 # And build always Release, to ensure optimisation flags
4150 cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags"