Commit 9d9ccd6c authored by Mark Olesen's avatar Mark Olesen

CONFIG: use updated OpenFOAM cmake/wmake scripts

parent 08e19fdf
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd "${0%/*}" || exit # Run from this directory
targetType=libso targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments . ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
echo "========================================" echo "========================================"
......
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd "${0%/*}" || exit # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The cmake functions export WM_CONTINUE_ON_ERROR=true # Optional unit
. ${WM_PROJECT_DIR:?}/wmake/scripts/cmakeFunctions # Cmake functions
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
#------------------------------------------------------------------------------
# CMake into objectsDir with external dependency #------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
# #
# 1 - depend # Note
# 2 - sourceDir # - use '-prefix=..' to define installation prefix (default: FOAM_LIBBIN)
# 3... optional cmake defines # - MPI detection may not work properly with later VTK/ParaView versions
# #------------------------------------------------------------------------------
# Available directly in OpenFOAM-1812 but left here for a while
# to ensure we can build with slightly older versions too (2018-11-29)
#
unset -f cmakeVersionedInstall 2>/dev/null
cmakeVersionedInstall()
{
local depend="$1"
local sourceDir="$2"
shift 2
local objectsDir sentinel
# Where generated files are stored
objectsDir=$(findObjectDir "$sourceDir") || exit 1 # Fatal
# Version changed # Default is openfoam (FOAM_LIBBIN)
sentinel=$(sameDependency "$depend" "$sourceDir") || \ : "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
rm -rf "$objectsDir" > /dev/null 2>&1
mkdir -p "$objectsDir" \ unset cmakeOpts
&& (cd "$objectsDir" && _cmake "$@" "$sourceDir" && make install) \ if [ -n "$CMAKE_INSTALL_PREFIX" ]
&& echo "$depend" >| "${sentinel:-/dev/null}" then
} export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
fi
# ----------------------------------------------------------------------------- #------------------------------------------------------------------------------
echo "======================================================================" echo "======================================================================"
echo "${PWD##*/} : $PWD" echo "${PWD##*/} : $PWD"
echo echo
# For FOAM_LIBBIN unset depend catalystDebug
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$WM_PROJECT_DIR/platforms/$WM_OPTIONS"
# or
# cmakeOpts="-DCMAKE_INSTALL_PREFIX=${FOAM_LIBBIN%/*}"
# For FOAM_USER_LIBBIN
# cmakeOpts="-DCMAKE_INSTALL_PREFIX=${FOAM_USER_LIBBIN%/*}"
# If available, prefer use of ParaView MESA
if [ -d "$ParaView_MESA_DIR" ]
then
export ParaView_DIR="$ParaView_MESA_DIR"
fi
unset depend
if [ -d "$ParaView_DIR" ] if [ -d "$ParaView_DIR" ]
then then
depend="ParaView_DIR=$ParaView_DIR" depend="ParaView_DIR=$ParaView_DIR"
fi fi
if [ -n "$depend" ]
if [ "$targetType" = objects ]
then
depend=ignore
elif [ -n "$depend" ]
then then
if [ "$targetType" != objects ] if have_cmake
then then
if command -v cmake > /dev/null 2>&1 echo "catalyst prefix : $CMAKE_INSTALL_PREFIX"
then cmakeVersionedInstall "$depend" "$PWD" $cmakeOpts || {
cmakeVersionedInstall "$depend" "$PWD" "$cmakeOpts" || { echo
echo echo " WARNING: incomplete build of ParaView Catalyst"
echo " WARNING: incomplete build of ParaView Catalyst" echo
echo }
} else
else echo "WARNING: skipped - needs cmake"
echo "WARNING: skipped - needs cmake"
fi
fi fi
else else
echo "WARNING: skip ParaView Catalyst (missing or incorrrect ParaView)" echo "WARNING: skip ParaView Catalyst (missing or incorrrect ParaView)"
......
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