Commit 766c82b8 authored by Mark Olesen's avatar Mark Olesen

BUG: incorrect installation prefix (fixes #2)

- struck by the old dash bug, but also has some remnants of building
  into the project directory by default. It should be the user
  directory for consistency with other modules.

  This can be overriden with the "-prefix" option.
parent e426bad6
......@@ -8,15 +8,19 @@ export WM_CONTINUE_ON_ERROR=true # Optional unit
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Note
# - '-prefix=..' to define installation prefix (default: FOAM_USER_LIBBIN)
# Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN}, CMAKE_INSTALL_PREFIX env varables
#
# Note
# - MPI detection may not work properly with later VTK/ParaView versions
#------------------------------------------------------------------------------
# Default to user location
: "${FOAM_MODULE_PREFIX:=${FOAM_USER_LIBBIN%/*}}"
: "${CMAKE_INSTALL_PREFIX:=$FOAM_MODULE_PREFIX}"
# - Long form to avoid dash 0.5.8 error (issue #1757)
[ -n "$FOAM_MODULE_PREFIX" ] || FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}"
[ -n "$CMAKE_INSTALL_PREFIX" ] || CMAKE_INSTALL_PREFIX="$FOAM_MODULE_PREFIX"
export FOAM_MODULE_PREFIX CMAKE_INSTALL_PREFIX
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
#------------------------------------------------------------------------------
......
......@@ -9,7 +9,7 @@ export WM_CONTINUE_ON_ERROR=true # Optional unit
#
# Note
# Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN} env varables
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN}, CMAKE_INSTALL_PREFIX env varables
#
# Note
# For paraview-5.7 (and later) plugins are built into their own subdirs.
......@@ -23,13 +23,13 @@ export WM_CONTINUE_ON_ERROR=true # Optional unit
#------------------------------------------------------------------------------
# Default to user location
: "${FOAM_MODULE_PREFIX:=${FOAM_USER_LIBBIN%/*}}"
: "${CMAKE_INSTALL_PREFIX:=$FOAM_MODULE_PREFIX}"
# - Long form to avoid dash 0.5.8 error (issue #1757)
[ -n "$FOAM_MODULE_PREFIX" ] || FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}"
[ -n "$CMAKE_INSTALL_PREFIX" ] || CMAKE_INSTALL_PREFIX="$FOAM_MODULE_PREFIX"
export FOAM_MODULE_PREFIX CMAKE_INSTALL_PREFIX
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
#------------------------------------------------------------------------------
warnIncomplete()
......
......@@ -8,20 +8,21 @@ export WM_CONTINUE_ON_ERROR=true # Optional unit
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Note
# - use '-prefix=..' to define installation prefix (default: FOAM_LIBBIN)
# Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN}, CMAKE_INSTALL_PREFIX env varables
#
# Note
# - can build with VTK or ParaView (preferred) libraries
# - MPI detection may not work properly with later VTK/ParaView versions
#------------------------------------------------------------------------------
# Default is openfoam (FOAM_LIBBIN)
: "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
# Default to user location
# - Long form to avoid dash 0.5.8 error (issue #1757)
[ -n "$FOAM_MODULE_PREFIX" ] || FOAM_MODULE_PREFIX="${FOAM_USER_LIBBIN%/*}"
[ -n "$CMAKE_INSTALL_PREFIX" ] || CMAKE_INSTALL_PREFIX="$FOAM_MODULE_PREFIX"
export FOAM_MODULE_PREFIX CMAKE_INSTALL_PREFIX
unset cmakeOpts
if [ -n "$CMAKE_INSTALL_PREFIX" ]
then
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
fi
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
#------------------------------------------------------------------------------
......
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