Files
Gleb Mazovetskiy 8896a34a13 Overhaul version handling
Stop using git for the version tag.
The new process is as follows:

1. The `VERSION` file contains the version.
   For release, it should contain "1.5.0".
   Immediately after the release, it should be changed to "1.6.0-dev".
2. The build type is included in the version string unless it is
   "Release". The commit hash is now included into the version string
   whenever the `VERSION` file has a suffix (i.e. 1.5.0-dev rather than
   just 1.5.0). The full version string for development builds now
   looks like this: `1.5.0-dev-Debug-b102dccf8`.

This means we longer need git or `-DVERSION_NUM` to get a sensible version number.

The in-development versions are now always clearly indicated with the
`-dev` suffix no matter how DevilutionX was built.
2023-05-06 21:18:50 +01:00

9 lines
305 B
CMake

function(get_git_commit_hash output_var)
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(${output_var} ${GIT_COMMIT_HASH} PARENT_SCOPE)
endfunction(get_git_commit_hash)