#
# This file is part of the GROMACS molecular simulation package.
#
# Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team.
# Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
#
# GROMACS is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your option) any later version.
#
# GROMACS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with GROMACS; if not, see
# http://www.gnu.org/licenses, or write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# If you want to redistribute modifications to GROMACS, please
# consider that scientific software is very special. Version
# control is crucial - bugs must be traceable. We will be happy to
# consider code for inclusion in the official distribution, but
# derived work must not be called official GROMACS. Details are found
# in the README & COPYING files - if they are missing, get the
# official version at http://www.gromacs.org.
#
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
# Sets version information variables and provides CMake functions for
# generating files based on them
#
# The following variables are derived from variables initialized by
# https://cmake.org/cmake/help/latest/command/project.html#command:project
# GMX_VERSION_MAJOR Major version number.
# GMX_VERSION_PATCH Patch version number.
# Should always be defined: zero for, e.g., 2016.
#
# This script provides the following basic version variables that need to be
# maintained manually:
# GMX_VERSION_SUFFIX String suffix to add to numeric version string.
# "-dev" is automatically added when not building from a source package,
# and does not need to be kept here. This mechanism is not quite enough
# for building a tarball, but setting the CMake cache variable
# GMX_BUILD_TARBALL=on will suppress the addition of "-dev" to the
# version string.
# LIBRARY_SOVERSION_MAJOR so major version for the built libraries.
# Should be increased for each binary incompatible release. In GROMACS,
# the typical policy is to increase it at the start of the development
# cycle for each major/minor version change, but not for patch releases,
# even if the latter may not always be fully binary compatible.
# Table of historical values
# GROMACS 5.0 0
# GROMACS 5.1 1
# GROMACS 2016 2
# GROMACS 2018 3
# GROMACS 2019 4
# GROMACS 2020 5
# GROMACS 2021 6
# GROMACS 2022 7
# LIBRARY_SOVERSION_MINOR so minor version for the built libraries.
# Should be increased for each release that changes only the implementation.
# In GROMACS, the typical policy is to increase it for each patch version
# change, even if they may not always be fully binary compatible.
# If it is somehow clear that the ABI implementation has not changed
# in a patch release, this variable should not increase. Release candidate
# and beta versions will not increase this number, since nobody should
# write code against such versions.
# LIBRARY_VERSION Full library version.
# REGRESSIONTEST_BRANCH For builds not from source packages, name of the
# regressiontests branch at gerrit.gromacs.org whose HEAD can test this
# code, *if* this code is recent enough (i.e., contains all changes from
# the corresponding code branch that affects the regression test
# results). Even after a release branch is forked for the source
# repository, the correct regressiontests branch can still be master,
# because we do not fork it until behaviour needs to change.
# REGRESSIONTEST_MD5SUM
# The MD5 checksum of the regressiontest tarball. Only used when building
# from a source package.
# GMX_SOURCE_DOI_ID
# ID collected from Zenodo connected to the doi for a released version
# used to identify the source when building an official released version.
# This ID is used for the source code tarball.
# GMX_MANUAL_DOI_ID
# Same as above, but for the reference manual.
# They are collected into a single section below.
# The following variables are set based on these:
# GMX_VERSION String composed from GMX_VERSION_* numeric variables
# above. Example: 4.6.1, 5.0, 2016
# GMX_VERSION_STRING String with GMX_VERSION suffixed with the given
# suffix and possibly "-dev" for builds not from a source package.
# GMX_VERSION_NUMERIC Numeric version number (e.g., 40601 for 4.6.1, 20160001 for 2016.1).
# GMX_API_VERSION Numeric API version.
# This is currently set automatically to GMX_VERSION_NUMERIC, but may
# become manually maintained in the future if there will be releases
# where the API does not change, but programs/libraries do.
# In such a case, this should be the first version where the current API
# appeared.
# REGRESSIONTEST_VERSION For source packages, version number of the
# matching regressiontests tarball. Not used for builds not from source
# packages.
# The latter two are used to generate gromacs/version.h to allow software
# written against the GROMACS API to provide some #ifdef'ed code to support
# multiple GROMACS versions.
#
# This script also declares machinery to generate and obtain version
# information from a git repository. This is enabled by default if the source
# tree is a git, but can be disabled with
# GMX_GIT_VERSION_INFO Advanced CMake variable to disable git
# version info generation.
# If the version generation is disabled, then the source and manual doi
# will be based on the stored values for the ID.
# The main interface to this machinery is the gmx_configure_version_file()
# CMake function. The signature is
# gmx_configure_version_file(