.. _dune_register_package_flags:

dune_register_package_flags
===========================

.. cmake_function:: dune_register_package_flags

   .. cmake_param:: INCLUDE_DIRS
      :multi:

      The list of include directories needed by the external package.

   .. cmake_param:: COMPILE_DEFINITIONS
      :multi:

      The list of compile definitions needed by the external package.

   .. cmake_param:: COMPILE_OPTIONS
      :multi:

      The list of compile options needed by the external package.

   .. cmake_param:: LIBRARIES
      :multi:

      The list of libraries that the external package should link to.
      The order of the input is preserved in the output.

   .. cmake_param:: APPEND
      :option:

      If this option is set, the definitions, flags and directories specified in this function are
      appended to the global collection of flags instead of being prepended. Only use it, if you know
      what you are doing.

   To correctly implement the automatic handling of external libraries, the compile flags, include paths and link
   flags of all found packages must be registered with this function. This function is only necessary for people that
   want to write their own :code:`FindFooBar` CMake modules to link against additional libraries which are not supported by
   the DUNE core modules. Call this function at the end of every find module. If you are using an external FindFoo
   module which you cannot alter, call it after the call to :code:`find_package(foo)`.

