Cmake: How to set rpath to ${ORIGIN} with cmake
问题 According to this SO question, Linux executable can't find shared library in same folder passing -Wl,-rpath,${ORIGIN} is the way to get a Linux executable to search for .so s in the same directory as the executable. We're using cmake, so I'm adding a line of the form target_link_options(Executable PRIVATE -Wl,-rpath=${ORIGIN}) to CMakeLists.txt. The problem with that is that cmake tries to interpret the nine character sequence ${ORIGIN} as a variable, and replaces it with nothing. So far, I