Reorganize CMake version information management
Main benefits:
- Less clutter in the beginning of the main CMakeLists.txt.
- CPack and regression test version numbers no longer need to be
updated separately.
- Easier to reuse the individual GMX_VERSION_* variables instead of
trying to parse PROJECT_VERSION.
- -dev suffix in the version string is now automatically managed, with
no need to patch the source code before packaging a source
distribution.
- All stuff related to git version info generation is now in one place,
and easy to reuse if one wants to add new files that would like to
embed the full version string. At least the new documentation build
targets could probably use this.
- Additional targets of such type do not cause the git commands to
generate the info run more than once per build (at least in most
cases).
- Remove some unused functionality and unnecessary checking from
gmxGenerateVersionInfo.cmake to streamline it. All the checks are
already done at a higher level.
Some cleanup on the way:
- Remove enable_language(C/CXX), as CMake by default enables C and C++.
- Clean up some indentation in affected parts.
- Rename variables to have consistent names throughout.
PROJECT_VERSION is now called GMX_VERSION_STRING, as the old name was
probably there mainly because autoconf named a similar variable in
config.h that way.
- Remove CUSTOM_VERSION_STRING, as it does not have a well-defined use.
If someone can come up with a use case, we can reintroduce a more
targeted mechanism for such customization.
Change-Id: I23ec2dc6a3ec7b33ba18272e766057f67ffb4bd4
15 files changed: