Make dolfin version available for comparison in preprocessor

Issue #415 resolved
Øyvind Evju created an issue

The macro DOLFIN_VERSION is today defined as a string, which isn't possible to use for comparisons in the preprocessor.

Is there a reason for this, or would it be possible to add definitions like this:

DOLFIN_VERSION_MAJOR DOLFIN_VERSION_MINOR DOLFIN_VERSION_MICRO DOLFIN_VERSION_STABLE

This way, it would be possible to check dolfin version in the preprocessor, and easily keep minor extensions compatible with several versions of dolfin.

Comments (7)

  1. Prof Garth Wells

    Would be handy. We could put it in a file dolfin/common/version.h. Needs a little bit of CMake code to write the file.

  2. Anders Logg (Chalmers)

    We have this for UFC (now part of FFC and versioning handled via setup.py), but it was handled in the past in UFC via CMake so it would be relatively easy to copy what we did then.

  3. Log in to comment