Commit c55d51b3 authored by Dominik Charousset's avatar Dominik Charousset

Allow git-less configuration of release version

parent ee359ebd
...@@ -599,11 +599,12 @@ endif() ...@@ -599,11 +599,12 @@ endif()
# -- Fetch branch name and SHA if available ------------------------------------ # -- Fetch branch name and SHA if available ------------------------------------
find_package(Git QUIET) if(EXISTS "release.txt")
file(READ "release.txt" CAF_VESION)
set(CAF_RELEASE "${CAF_VERSION}") else()
set(CAF_RELEASE "${CAF_VERSION}")
if(GIT_FOUND) find_package(Git QUIET)
if(GIT_FOUND)
# retrieve current branch name for CAF # retrieve current branch name for CAF
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
...@@ -636,6 +637,7 @@ if(GIT_FOUND) ...@@ -636,6 +637,7 @@ if(GIT_FOUND)
endif() endif()
endif() endif()
endif() endif()
endif()
endif() endif()
message(STATUS "Set release version for all documentation to ${CAF_RELEASE}.") message(STATUS "Set release version for all documentation to ${CAF_RELEASE}.")
......
#!/bin/sh
grep "define CAF_VERSION" libcaf_core/caf/config.hpp | awk '{printf "%d.%d.%d", int($3 / 10000), int($3 / 100) % 100, $3 % 100}' > version.txt
git rev-parse --abbrev-ref HEAD > branch.txt
git log --pretty=format:%h -n 1 > sha.txt
if test "$(cat branch.txt) = master" && git describe --tags --contains $(cat sha.txt) 1>tag.txt 2>/dev/null ; then
cp tag.txt release.txt
else
printf "%s" "$(cat version.txt)+exp.sha.$(cat sha.txt)" > release.txt
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment