summaryrefslogtreecommitdiff
path: root/cmake/utils/GenVersionHeader.cmake
Commit message (Collapse)AuthorAgeFilesLines
* build: Automatically parse version from tagDimitri Staessens39 hours1-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The build will now parse tags so the git tag is now the single source of truth for a version. We do not need to manually maintain the version header. The VERSION file uses git's export-subst feature. When git archive creates a snapshot (e.g. cgit), git substitutes the $Format:...$ placeholder with the output of git describe, embedding the version string directly in the archive. This requires the export-subst attribute to be set for the VERSION file in the repository's .gitattributes. The version is resolved in the following order: - git describe (inside a git repository with tags) - the VERSION file (archives/snapshots) - 0.0.0 (fallback) The build system will warn when it can't set a correct version, such as in a git repo without tags, or an archive without VERSION. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Add git hash to version stringDimitri Staessens39 hours1-0/+11
Embed git commit hash into version.h and irmd --version output using git describe. Regenerated at build time to stay current across commits. Ouroboros version MAJOR.MINOR.PATCH (TAG-COMMITS-GHASH-dirty) Example for dirty work tree (uncommitted changes): $ irmd --version Ouroboros version 0.22.0 (0.22.0-36-g86dba544-dirty) Example after commit: $ sudo irmd --version Ouroboros version 0.22.0-37-g55fa9445 Officical release (on tag): Ouroboros version 0.22.0 Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>