.. _dune_add_library:

dune_add_library
================

.. cmake_function:: dune_add_library

   .. cmake_brief::

      Add a library to a Dune module!

   .. cmake_param:: basename
      :single:
      :required:
      :positional:

      The basename for the library. On Unix this created :code:`lib<basename>.so`
      and :code:`lib<basename>.a`

   .. cmake_param:: NO_EXPORT
      :option:

      If omitted the library is exported for usage in other modules.

   .. cmake_param:: ADD_LIBS
      :multi:

      A list of libraries that should be incorporated into this library.

   .. cmake_param:: APPEND
      :option:

      Whether the library should be appended to the
      exported libraries. If there a DUNE module must
      make several libraries available, then first one
      must not use this option but the others have to
      use it. Otherwise only the last library will be
      exported as the others will be overwritten.

   .. cmake_param:: OBJECT
      :option:

      .. note::
         This feature will very likely vanish in Dune 3.0

   .. cmake_param:: SOURCES
      :multi:
      :required:

      The source files from which to build the library.

   .. cmake_param:: COMPILE_FLAGS
      :single:

      Any additional compile flags for building the library.

