Reorganize CMake version information management
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 28 Jul 2014 04:08:19 +0000 (07:08 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 13 Aug 2014 21:38:23 +0000 (23:38 +0200)
commit643944e7f41c74ce4f0ca7b475fddcdfb241482b
treebb898e0a56f174206faa5a9e4e4cd18fbef1d013
parent6400ed5de8d26899d750a2652f7bf9e54125c540
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:
.gitignore
CMakeLists.txt
cmake/VersionInfo.cmake.cmakein [new file with mode: 0644]
cmake/gmxConfigureVersionInfo.cmake [new file with mode: 0644]
cmake/gmxGenerateVersionInfo.cmake
cmake/gmxVersionInfo.cmake [new file with mode: 0644]
doxygen/CMakeLists.txt
doxygen/Doxyfile-version.cmakein
install-guide/configure-install-guide.cmake.in
manual/macros.tex
src/gromacs/CMakeLists.txt
src/gromacs/libgromacs.pc.cmakein
src/gromacs/utility/baseversion-gen.c.cmakein
src/gromacs/version.h.cmakein
tests/CMakeLists.txt