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

CONFIG: use updated OpenFOAM cmake/wmake scripts

parent 08e19fdf
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
cd "${0%/*}" || exit # Run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
echo "========================================"
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The cmake functions
cd "${0%/*}" || exit # Run from this directory
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
# 2 - sourceDir
# 3... optional cmake defines
#
# 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
# Note
# - use '-prefix=..' to define installation prefix (default: FOAM_LIBBIN)
# - MPI detection may not work properly with later VTK/ParaView versions
#------------------------------------------------------------------------------
# Version changed
sentinel=$(sameDependency "$depend" "$sourceDir") || \
rm -rf "$objectsDir" > /dev/null 2>&1
# Default is openfoam (FOAM_LIBBIN)
: "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
mkdir -p "$objectsDir" \
&& (cd "$objectsDir" && _cmake "$@" "$sourceDir" && make install) \
&& echo "$depend" >| "${sentinel:-/dev/null}"
}
unset cmakeOpts
if [ -n "$CMAKE_INSTALL_PREFIX" ]
then
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
fi
# -----------------------------------------------------------------------------
#------------------------------------------------------------------------------
echo "======================================================================"
echo "${PWD##*/} : $PWD"
echo
# For FOAM_LIBBIN
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$WM_PROJECT_DIR/platforms/$WM_OPTIONS"
unset depend catalystDebug
# 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" ]
then
depend="ParaView_DIR=$ParaView_DIR"
fi
if [ -n "$depend" ]
if [ "$targetType" = objects ]
then
depend=ignore
elif [ -n "$depend" ]
then
if [ "$targetType" != objects ]
if have_cmake
then
if command -v cmake > /dev/null 2>&1
then
cmakeVersionedInstall "$depend" "$PWD" "$cmakeOpts" || {
echo
echo " WARNING: incomplete build of ParaView Catalyst"
echo
}
else
echo "WARNING: skipped - needs cmake"
fi
echo "catalyst prefix : $CMAKE_INSTALL_PREFIX"
cmakeVersionedInstall "$depend" "$PWD" $cmakeOpts || {
echo
echo " WARNING: incomplete build of ParaView Catalyst"
echo
}
else
echo "WARNING: skipped - needs cmake"
fi
else
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