]> https://gitweb.dealii.org/ - dealii.git/commit
CMake: Add rpath to example steps 6098/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 24 Mar 2018 01:05:21 +0000 (20:05 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 24 Mar 2018 01:05:21 +0000 (20:05 -0500)
commitf634790e9afb61c9f01e079fe031fb6f35184c90
treee9d69d4ee599cca507c6af8661b725c44408e785
parent41982b10258e353c55d984379408101ea51819f0
CMake: Add rpath to example steps

Quoting from the documentation [1]
  """
  CMAKE_INSTALL_RPATH_USE_LINK_PATH is an interesting and very useful
  option. When building a target with RPATH, CMake determines the RPATH
  by using the directories of all libraries to which this target links.
  Some of these libraries may be located in the same build tree, e.g.
  libbar.so, these directories are also added to the RPATH. If this
  option is enabled, all these directories except those which are also
  in the build tree will be added to the install RPATH automatically.
  The only directories which may then still be missing from the RPATH
  are the directories where the libraries from the same project (i.e.
  libbar.so) are installed to. If the install directory for the
  libraries is not one of the systems default library directories, you
  have to add this directory yourself to the install RPATH by setting
  CMAKE_INSTALL_RPATH accordingly.
  """

Well, let's simply add the missing rpath to the install location for our
example binaries then. We guard this with
CMAKE_INSTALL_RPATH_USE_LINK_PATH in case augment the INSTALL_RPATH
so that CMake doesn't populate any rpath in case the user doesn't want
that.

[1] https://cmake.org/Wiki/CMake_RPATH_handling

Fixes #6096
examples/CMakeLists.txt

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.