DuneEnableAllPackages --------------------- Commands for simplified package flag handling in the DUNE build system. .. cmake:command:: dune_enable_all_packages Register all discovered package flags and libraries for subsequent targets in the current directory scope and its subdirectories. .. code-block:: cmake dune_enable_all_packages( [INCLUDE_DIRS ] [COMPILE_DEFINITIONS ] [COMPILE_OPTIONS ] [MODULE_LIBRARIES ] [VERBOSE] [APPEND] ) This command provides a simplified mode in which all collected external package flags are applied automatically to targets created later in the module. ``INCLUDE_DIRS`` Additional include directories added to all subsequent targets. ``COMPILE_DEFINITIONS`` Additional compile definitions added to all subsequent targets. ``COMPILE_OPTIONS`` Additional non-definition compile options added to all subsequent targets. ``MODULE_LIBRARIES`` Libraries from the current module that should participate in the automatic linking setup. If programs in the module should link to those libraries automatically, they must be listed here. ``VERBOSE`` Print the resulting compile flags, linked libraries, and include directories during configuration. ``APPEND`` Append the provided flags to the global collection instead of prepending them. If used, this command must be called in the top-level ``CMakeLists.txt`` before adding subdirectories. For modern module libraries, prefer :cmake:command:`dune_add_library` and explicit target properties when possible. .. cmake:command:: dune_target_enable_all_packages Add all currently registered package flags to specific targets. .. code-block:: cmake dune_target_enable_all_packages(TARGETS ) ``TARGETS`` The targets receiving the currently registered package flags. The added flags use ``PUBLIC`` scope for compiled libraries and ``INTERFACE`` scope otherwise. .. cmake:command:: dune_register_package_flags Register package-specific include paths, compile flags, and link libraries. .. code-block:: cmake dune_register_package_flags( [INCLUDE_DIRS ] [COMPILE_DEFINITIONS ] [COMPILE_OPTIONS ] [LIBRARIES ] [APPEND] ) ``INCLUDE_DIRS`` Include directories required by the external package. ``COMPILE_DEFINITIONS`` Compile definitions required by the external package. ``COMPILE_OPTIONS`` Compile options required by the external package. ``LIBRARIES`` Libraries that should be linked for the external package. The order of the input is preserved. ``APPEND`` Append the specified values to the global collection instead of prepending them. This command is primarily intended for custom ``FindFoo`` modules or for integrating external find modules that cannot be modified directly. .. cmake:command:: dune_library_add_sources Register sources for a module library created through the automatic package handling workflow. .. code-block:: cmake dune_library_add_sources( SOURCES ) ``module_library`` The name of the module library target. ``SOURCES`` Source files added to the DUNE module library ``module_library``. The target must have been created earlier by :cmake:command:`dune_enable_all_packages` in the current module.