[Dune] cmake build, how to specify non-standard libraries

Markus Blatt markus at dr-blatt.de
Mon Nov 24 18:28:47 CET 2014


Hi Benedikt,

On Mon, Nov 24, 2014 at 05:10:46PM +0100, Benedikt Oswald wrote:
> Dear Dune,
> 
> one question regarding linking non-standard libraries, say boost.
> How would I specify them via the cmake opts files ?
> 
> Someting like this?
> 
> USE_CMAKE=yes
> 
> on the other hand, I understand that in the CMAKE_PREFIX_PATH I specify
> the base directories,
> but still I need to tell it which specific boost libraries need to be
> linked.
>

This is just for find_package.


I suppose you mean passing these libraries to cmake similiar to
LDFLAGS and LD_LIBRARIES?

If that is not the case, please tell us how you did this with
autotools.

You might want to check out the following variables:

mblatt at boromir:~$ cmake --help-variable CMAKE_STANDARD_LIBRARIES
cmake version 2.8.9
  CMAKE_STANDARD_LIBRARIES
       Libraries linked into every executable and shared library.

       This is the list of libraries that are linked into all
       executables and
       libraries.

mblatt at boromir:~$ cmake --help-variable CMAKE_LIBRARY_PATH
cmake version 2.8.9
  CMAKE_LIBRARY_PATH
       Path used for searching by FIND_LIBRARY().

       Specifies a path which will be used by FIND_LIBRARY().
       FIND_LIBRARY()
       will check each of the contained directories for the existence
       of the
       library which is currently searched.  By default it is empty,
       it is
       intended to be set by the project.  See also
       CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_PREFIX_PATH.



But of course the more usual way would be to use find_package to find
these in your module and specify them via link_libraries. For boost,
see

cmake --help-module FindBoost

Cheers,

Markus


-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20141124/e6df761c/attachment.sig>


More information about the Dune mailing list