OPM/opm-core — pull request #290 by rolk (2013-07-31 11:30:24+00:00)
Title: Embed version string into the library

The label put in dune.module is propagated into the library together with the SHA hash of the current commit. This enables us to identify the version used to run results with e.g.:

#include
// ...
std::cerr << "Using opm-core v." << opm_core_version << std::endl;

Care is taken to not rebuild more than necessary when the SHA is updated. However, as the library is updated, all the examples and unit tests will be rebuilt, regardless of the magnitude of the change. Therefore, if CMAKE_BUILD_TYPE=Debug, the SHA is **not** embedded, as this typically get tiresome during development.

The reason this is a symbol instead of a preprocessing define is so that one will get the version of the current library, and not the one whose headers were used to compile the client code (it may not be the same).

This pull requests replaces/supersedes OPM/opm-core#245