Skip to content

DuneMacros.cmake: find_dune_package version check differs from version check in dunecontrol

While looking at dune-localfunctions!117 (closed) we noticed that our buildsystem implements two different version checks:

  • dunecontrol uses check_version (in lib/dunemodules.lib)
  • cmake has a version check in find_dune_package (in cmake/modules/DuneMacros.cmake)

These version checks differ in several ways:

  • dunecontrol allows multiple constraints (e.g. dune-common (>= 2.7 && < 2.8)), cmake only one
  • dunecontrol implements <, >, =, <= and >=; cmake only the last three

In particular the comparison introduced in dune-localfunctions!117 (closed) is only parsed as dune-common (>= 2.7) in cmake; it also fails if additional whitespace is added (i.e. dune-common (>=2.7&&<2.8) works, but dune-common (>= 2.7 && < 2.8) results in a cmake error)