Giter Site home page Giter Site logo

cmake-versioning's Introduction

CMake module for software versioning using Git

Purpose

The version.cmake CMake module provides a mechanism to build a version tag via Git.

Behavior

  1. If a version.txt exists at the base directory (CMake base directory), it will be used as a base version.

  2. Then, if a git tag in a semantic version format exists ({major}.{minor}.{patch}), the latest git tag will be used to update the base version.

For example, on master or any other branch, after building via CMake, the version would be v0.15.0+something (given that version.txt starts from 0.15.0) instead of v0.0.0+something.

This module produces tags like these:

  • no git tag: 0.0.0+gitg24cc43a

  • git tag v0.9.0 but diverged from master: 0.9.0

  • git tag v0.9.0 but dirty: 0.9.0+gitg24cc43a

  • git tag v0.9.0 but committed after tag: v0.9.0.1-g24cc43a

  • git tag v0.9.0 but committed after tag, dirty: v0.9.0.1-g24cc43a-dirty

  • v0.9.0-1-g24cc43a: version.txt is 0.9.0, and git commit at g24cc43a.

  • if repository dirty: v0.9.0-1-g24cc43a-dirty

  • have version.txt, git commits, but no release tags: 0.15.1+git20210101.g24cc43a

Credits

Copyright Ribose.

cmake-versioning's People

Contributors

dewyatt avatar ni4 avatar ronaldtse avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ni4

cmake-versioning's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.