DuneProject

Initialize and finalize a Dune module.

dune_project

Initialize a DUNE module from its top-level CMakeLists.txt.

dune_project()

This command should be called from every module top-level CMakeLists.txt file. It reads dune.module, initializes the standard Project* variables, finds required and suggested DUNE dependencies, enables the project documentation and header-check infrastructure, and prepares the build system for module-specific macros and package exports.

Call finalize_dune_project() at the end of the same CMakeLists.txt file.

finalize_dune_project

Finalize the top-level DUNE project setup and generate export metadata.

finalize_dune_project()

Changed in version 2.10: The legacy arguments to finalize_dune_project() were removed. The command no longer takes parameters.

This command should be run at the end of every top-level CMakeLists.txt file. Among other things it creates the cmake package configuration file and package version file. Modules can add additional entries to these files by setting the variable ${ProjectName}_INIT.

Based on the template config.h.cmake in the project directory, a private header file ${module}-private-config.hh and a public header file ${module}-config.hh are created. The public header is installed. For legacy reasons, the file config.h with collected upstream configuration files is also created. For more information, see the build system documentation.

dune_mark_module_as_required_dependency

Force a suggested module dependency to become required downstream.

dune_mark_module_as_required_dependency(MODULE <module>)

Added in version 2.11.

MODULE

Name of the suggested dependency that should be treated as required for downstream consumers.

Use this when a dependency listed only in the section Suggested: of the dune.module file becomes effectively required once it is found, for example because corresponding source files are compiled into the module library. Call this command after dune_project() and before finalize_dune_project().