STYLE: clearly document which scripts contain user-configurable settings

- unify cd, check for the cwd and error message
This commit is contained in:
mark
2017-01-19 20:47:15 +01:00
parent 9926569ca1
commit 1622a46832
17 changed files with 221 additions and 229 deletions

View File

@ -33,27 +33,25 @@
#
# Note the capitalization of ParaView in the directory names.
#
# ------------------------------------------------
# SOME USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Get ParaView_VERSION location from OpenFOAM config file
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
# ParaView_VERSION from OpenFOAM etc/config.sh file
. $WM_PROJECT_DIR/etc/config.sh/functions
unset -f _foamAddPath _foamAddLib # get settings only
unset ParaView_VERSION # purge current values
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview)
: ${ParaView_VERSION##*-}
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
#
# USER DEFAULTS:
@ -69,7 +67,7 @@ MESA_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so"
# If that fails, specify the path using the PYTHON_LIBRARY variable below.
withPYTHON=false
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.6.so.1.0"
# PYTHON_LIBRARY="/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.7.so.1.0"
# New rendering backend (starting with paraview 5.0).
# Default to auto-config based on paraview version
@ -79,14 +77,13 @@ withGL2=auto
# NO FURTHER EDITING BELOW THIS LINE
#
#-----------------------------------------------------------------------------
Script=${0##*/}
usage() {
: ${ParaView_VERSION:=none} # some dummy value for usage information
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [paraview-VERSION] [CMAKE-OPTION]
usage: ${0##*/} [OPTION] [paraview-VERSION] [CMAKE-OPTION]
options:
-gcc force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-rebuild for repeated builds (-make -install) *use with caution*
@ -116,7 +113,7 @@ The -no-FEATURE option can be used to forcibly disable these features:
CMake options start with a capital letter and contain an '='.
For example,
$Script BUILD_TESTING=ON
${0##*/} BUILD_TESTING=ON
to add tests
For finer control, the build stages can be selected or deselected individually: