Skip to content

Getting version and git hashes

Mayeul d'Avezac edited this page Apr 11, 2014 · 1 revision

A function is provided that will set a project's version and git hash during the configure step of the cmake process. By configure, we mean the information is updated only when CMake proper is run.

include(VersionAndGitRef)
set_version(0.1)
get_gitref()

It will set the ${PROJECT_NAME}_VERSION and ${PROJECT_NAME}_GITREF variables in the caller's scope.