Ignore undefined policies if QUIET is passed to dune_policy(SET)

If a Dune policy is not defined and a module calls dune_policy(SET) with this policy, currently a fatal error is shown. This behavior makes it hard to write modules that support multiple dune versions. In particular, one needs to know in which dune version which policy is introduced. Unfortunately, a check like in CMake: if(POLICY <policy>) cannot be implemented. One would need to provide a cmake function with an output parameter to check for the existence of a policy. This is also complicated to used.

There are two alternatives:

  1. Relax the dune_policy(SET) command, to accept undefined policies that are simply ignored. We could invert the logic and provide a global option to activate warnings about unset policies.
  2. Provide an additional argument QUIET to the function dune_policy(SET) that suppresses the check for undefined policies and then simply does nothing. (This is proposed in this MR)

Which of the two alternatives should be implement?

Merge request reports

Loading