In our project, the main CMakeLists.txt has the below two lines at the very beginning -
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0095 NEW)
Also, we are setting CMAKE_INSTALL_RPATH
set(CMAKE_INSTALL_RPATH “${ORIGIN}”)
the cmake_install.cmake file has the below lines:
file(RPATH_CHANGE
FILE “${file}”
OLD_RPATH “lib::::”
NEW_RPATH “$ORIGIN”)
The final shared library that gets built also has the escape '' character
The escaping '' does not help. Can anyone help in understanding as to how we can have only “${ORIGIN}” without the ''
I know some runtime loaders support ${ORIGIN}, but I’m not sure if that is universally supported on all unix systems where $ORIGIN is supported. It is very rare to see ${ORIGIN} used, the only place I’ve seen it mentioned is in the ld.so man page on Linux.