Files
openfoam/src/functionObjects/graphics/runTimePostProcessing/Allwmake

70 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
echo
echo "======================================================================"
echo "${PWD##*/} : $PWD"
echo
# CMake into objectsDir,
# with an additional attempt if (possibly incorrect) CMakeCache.txt existed
doCmake()
{
local sourceDir="$1"
findObjectDir $sourceDir # Where are generated files stored?
test -f "$objectsDir/CMakeCache.txt"
retry=$? # CMakeCache.txt exists, but sources may have moved
mkdir -p $objectsDir && \
(
cd $objectsDir || exit 1
cmake $sourceDir || {
if [ $retry -eq 0 ]
then
echo "Removing CMakeCache.txt and attempt again"
rm -f CMakeCache.txt
cmake $sourceDir
else
exit 1
fi
} && make
)
}
if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ]
then
if [ "$targetType" != objects ]
then
if type cmake > /dev/null 2>&1
then
doCmake $PWD || {
echo
echo " WARNING: incomplete build of VTK-based post-processing"
echo
}
else
echo "WARNING: skipped - needs cmake"
fi
fi
else
echo "WARNING: skipped - needs a VTK or a ParaView installation"
echo " - For ParaView : export the 'ParaView_DIR' variable"
echo " - For VTK : export the 'VTK_DIR' variable"
fi
echo "======================================================================"
echo
# -----------------------------------------------------------------------------