osrm-backend/include/util/version.hpp.in
Michael Bell d0e3e2af23
Extract prerelease/build information from package semver (#6839)
* Extract prerelease/build information from package semver

Currently we only extract the major.minor.patch identifiers from
the semver label stored in package.json.

This leads to version information in executables incorrectly
reporting a release version is running on prereleases and special builds.

This commit is a quickfix to extract this information and report it
in version strings.

CMake regex parsing is not sophisticated enough to handle the full semver
regex, so we might need to explore other CMake modules if we want to
strictly parse the label.
2024-03-24 18:33:07 +00:00

14 lines
562 B
C++

#ifndef VERSION_HPP
#define VERSION_HPP
#define OSRM_VERSION_MAJOR @OSRM_VERSION_MAJOR@
#define OSRM_VERSION_MINOR @OSRM_VERSION_MINOR@
#define OSRM_VERSION_PATCH @OSRM_VERSION_PATCH@
#define OSRM_VERSION_PRERELEASE_BUILD "@OSRM_VERSION_PRERELEASE_BUILD@"
#define OSRM_VERSION__(A,B,C,D) "v" #A "." #B "." #C D
#define OSRM_VERSION_(A,B,C,D) OSRM_VERSION__(A,B,C,D)
#define OSRM_VERSION OSRM_VERSION_(OSRM_VERSION_MAJOR, OSRM_VERSION_MINOR, OSRM_VERSION_PATCH, OSRM_VERSION_PRERELEASE_BUILD)
#endif // VERSION_HPP