Setting CMAKE_SKIP_INSTALL_RPATH=ON instead of removing the line should also work, but we still need to set LD_LIBRARY_PATH in the wrapper scripts.