Set relative INSTALL_RPATH on shared libceres

Abseil sets INSTALL_RPATH to @loader_path on Apple and $ORIGIN on
other Unix systems for all of its shared libraries so they can find
sibling libraries in the same install directory.

libceres is installed into the same directory and links privately
against Abseil (and potentially other co-installed shared libraries),
but did not set INSTALL_RPATH. On Linux, DT_RUNPATH on a downstream
executable is not transitive, so running a binary against a
non-system install prefix failed to find libabsl_*.so. On macOS,
installed consumers or dlopen callers face the same issue.

Append @loader_path on Apple and $ORIGIN on other Unix systems to
ceres's INSTALL_RPATH when BUILD_SHARED_LIBS is enabled. Using APPEND
preserves any user-specified CMAKE_INSTALL_RPATH, and packagers using
CMAKE_SKIP_INSTALL_RPATH=ON remain unaffected.

Change-Id: I9336b63f14fada7db883f0aa5bf3955a8bae8941
1 file changed
tree: 652ea4463ac86f773b6a9041bf2bb885ec87b1ef
  1. .github/
  2. bazel/
  3. cmake/
  4. config/
  5. data/
  6. docs/
  7. examples/
  8. include/
  9. internal/
  10. LICENSES/
  11. scripts/
  12. third_party/
  13. .bazelignore
  14. .clang-format
  15. .gitignore
  16. .gitmodules
  17. .readthedocs.yaml
  18. BUILD
  19. CITATION.cff
  20. CMakeLists.txt
  21. CONTRIBUTING.md
  22. LICENSE
  23. MODULE.bazel
  24. package.xml
  25. README.md
  26. REUSE.toml
  27. WORKSPACE
README.md

Android Linux macOS Windows

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see the Ceres Solver website for more information.