diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index adf05f1af978..eaabb37f4987 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -47,15 +47,9 @@ cmakeConfigurePhase() { cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags" cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags" - # Always build Release, to ensure optimisation flags. - cmakeFlags="-DCMAKE_BUILD_TYPE=Release $cmakeFlags" - # Do not change the RPATH between build and install, simply - # build with the correct RPATH in the first place. - cmakeFlags="-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE $cmakeFlags" - # Do not try to guess the correct RPATH based on linker flags. - cmakeFlags="-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE $cmakeFlags" - # Just use exactly our RPATH. - cmakeFlags="-DCMAKE_INSTALL_RPATH=$CMAKE_INSTALL_RPATH $cmakeFlags" + # Avoid cmake resetting the rpath of binaries, on make install + # And build always Release, to ensure optimisation flags + cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}" @@ -83,7 +77,6 @@ makeCmakeFindLibs(){ ;; -L*) export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}" - export CMAKE_INSTALL_RPATH="$CMAKE_INSTALL_RPATH${CMAKE_INSTALL_RPATH:+:}${flag:2}" ;; esac done