mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
use git describe for header version, but use existing wmake framework
This commit is contained in:
@ -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
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,15 @@
|
|||||||
.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)
|
||||||
|
|||||||
Reference in New Issue
Block a user