set(CMAKE_SKIP_INSTALL_RPATH TRUE) 构建期间和安装期间不允许CMake给你加入相关RPATH, 想要追加RPATH, 只需要对这三个变量设置成FALSE。 不过,默认CMake在帮你编译之后,如果你使用了相关动态库,它会在相应的exec文件中增加你相关生成动态库的路径,这样当你每次去执行的时候你不需要每次都LD_LIBRARY_PATH就可以正...
set(CMAKE_BUILD_WITH_INSTALL_RPATHON) This is required because the standard interaction with CMake when using Conan is to build, but not install, the binary. With this addition, the built executable from Conan works in exactly the way you would expect when running on MacOS and requires no...
CMake provides options to switch that behaviour of entirely for a build (seehttps://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling). I was searching the Meson docs to see if that is also possible with Meson, but can't find any - I can't even find documentation...
I ran grep on a few autotools and cmake build directories, and I didn't find any use of -rpath-link there. Probably they just assume users will set LD_LIBRARY_PATH themselves to satisfy the need of ld.bfd, but setting LD_LIBRARY_PATH can create problems for cmake and meson. Sorry,...