Skip to content
Snippets Groups Projects
Commit b5f06a38 authored by Mark Olesen's avatar Mark Olesen
Browse files

use git describe for header version, but use existing wmake framework

parent ae9057c9
Branches
Tags
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
# force update of Foam::FOAMversion string (git tag or $WM_PROJECT_VERSION)
/bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null
wmakeLnInclude -f OpenFOAM wmakeLnInclude -f OpenFOAM
wmakeLnInclude -f OSspecific/$WM_OS wmakeLnInclude -f OSspecific/$WM_OS
Pstream/Allwmake Pstream/Allwmake
......
...@@ -31,13 +31,22 @@ License ...@@ -31,13 +31,22 @@ License
template<class Stream> template<class Stream>
inline void Foam::IOobject::writeBanner(Stream& os, bool noHint) inline void Foam::IOobject::writeBanner(Stream& os, bool noHint)
{ {
static bool spacesSet = false; static bool spacesSet(false);
static char spaces[40]; static char spaces[40];
if (!spacesSet) if (!spacesSet)
{ {
memset(spaces, ' ', 40); memset(spaces, ' ', 40);
spaces[38 - strlen(Foam::FOAMversion)] = '\0';
size_t len = strlen(Foam::FOAMversion);
if (len < 38)
{
spaces[38 - len] = '\0';
}
else
{
spaces[0] = '\0';
}
spacesSet = true; spacesSet = true;
} }
......
.SUFFIXES: .Cver .SUFFIXES: .Cver
Cvertoo = sed s/WM_PROJECT_VERSION/\"$(WM_PROJECT_VERSION)\"/ $$SOURCE > $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@ #
# update version string from git, or just use the WM_PROJECT_VERSION
# note: could also add --abbrev=32 for maximum resolution
#
Cvertoo = \
sed s/WM_PROJECT_VERSION/\"$(shell \
git describe --always --tags 2>/dev/null || \
echo $(WM_PROJECT_VERSION) \
)\"/ $$SOURCE > $*.C; \
$(CC) $(c++FLAGS) -c $*.C -o $@
.Cver.dep: .Cver.dep:
$(MAKE_DEP) $(MAKE_DEP)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment