Commit cd75cb4a by Arnaud Botella Committed by Copybara-Service

PR #1709: Handle RPATH CMake configuration

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1709

When depending on a compiled abseil code, abseil libraries cannot find each other even if they are all located in the same directory.

One fix is to edit the LD_LIBRARY_PATH, but it is not always that simple in a development environment.

Another way is to add the current location into the RPATH so all libraries can find each other. CMake provides simple command to control this at project scale.
Merge caa92e67426784b1537009a24abeaeccba1ca8d4 into cd7f66ca

Merging this change closes #1709

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1709 from Geode-solutions:master caa92e67426784b1537009a24abeaeccba1ca8d4
PiperOrigin-RevId: 651476097
Change-Id: Ib3f214ac17adabefedfb562127f2b1de413ce437
parent 26ee072e
......@@ -41,6 +41,10 @@ else()
option(ABSL_ENABLE_INSTALL "Enable install rule" ON)
endif()
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
option(ABSL_PROPAGATE_CXX_STD
"Use CMake C++ standard meta features (e.g. cxx_std_14) that propagate to targets that link to Abseil"
OFF) # TODO: Default to ON for CMake 3.8 and greater.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment