COMP: robuster storage of pv/vtk sentinel files with out-of-source builds

This commit is contained in:
Mark Olesen
2020-01-09 16:48:20 +01:00
parent b1a866c37c
commit 8fdb9b2f70
2 changed files with 24 additions and 8 deletions

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2017-2019 OpenCFD Ltd.
# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -61,6 +61,22 @@ sameDependency()
fi
}
#
# Save dependency information into sentinel file
#
storeDependency()
{
local depend="$1"
local sentinel="$2"
if [ -n "$sentinel" ]
then
mkdir -p "$(dirname "$sentinel")"
echo "$depend" >| "$sentinel"
fi
return 0
}
# CMake with output suppressed according to WM_QUIET
_cmake()
@ -98,7 +114,7 @@ cmakeVersioned()
mkdir -p "$objectsDir" \
&& (cd "$objectsDir" && _cmake "$@" "$sourceDir" && make) \
&& echo "$depend" >| "${sentinel:-/dev/null}"
&& storeDependency "$depend" "$sentinel"
}
@ -124,7 +140,7 @@ cmakeVersionedInstall()
mkdir -p "$objectsDir" \
&& (cd "$objectsDir" && _cmake "$@" "$sourceDir" && make install) \
&& echo "$depend" >| "${sentinel:-/dev/null}"
&& storeDependency "$depend" "$sentinel"
}
@ -151,7 +167,7 @@ wmakeVersioned()
mkdir -p "$objectsDir" \
&& wmake "$@" \
&& echo "$depend" >| "${sentinel:-/dev/null}"
&& storeDependency "$depend" "$sentinel"
}

View File

@ -5,7 +5,7 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2019 OpenCFD Ltd.
# Copyright (C) 2018-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -97,11 +97,11 @@ wmakeLibPv()
for libName
do
sentinel=$(sameDependency "$depend" $libName) || \
sentinel=$(sameDependency "$depend" "$libName") || \
wclean $libName
wmake $targetType $libName \
&& echo "$depend" > ${sentinel:-/dev/null}
&& storeDependency "$depend" "$sentinel"
done
}
@ -148,7 +148,7 @@ get_pvplugin_api()
#
have_pvplugin_support()
{
local header settings warn pv_api installDir binDir includeDir targetDir
local header warn pv_api installDir binDir includeDir targetDir
warn="==> skip paraview-plugin"
# Trivial check