Patch provided by Bruno Santos
This commit is contained in:
Henry Weller
2016-04-03 14:43:58 +01:00
parent 1379e08a39
commit 69dba76b31
3 changed files with 79 additions and 21 deletions

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -74,7 +74,10 @@ setDirs()
# #
setVersion() setVersion()
{ {
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}" if [ "$#" -ge 1 ]
then
ParaView_VERSION="${1##paraview-}"
fi
# the major version is "<digits>.<digits>" # the major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \ ParaView_MAJOR=$(echo $ParaView_VERSION | \
@ -155,7 +158,10 @@ addCMakeVariable()
# #
addVerbosity() addVerbosity()
{ {
[ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" if [ "${withVERBOSE:=false}" = true ]
then
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
fi
} }
@ -164,7 +170,11 @@ addVerbosity()
# #
addMpiSupport() addMpiSupport()
{ {
[ "${withMPI:=false}" = true ] || return if [ "${withMPI:=false}" != true ]
then
return
fi
OBJ_ADD="$OBJ_ADD-mpi" OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON" addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON"
@ -177,7 +187,11 @@ addMpiSupport()
# #
addPythonSupport() addPythonSupport()
{ {
[ "${withPYTHON:=false}" = true ] || return if [ "${withPYTHON:=false}" != true ]
then
return
fi
OBJ_ADD="$OBJ_ADD-py" OBJ_ADD="$OBJ_ADD-py"
if pythonBin=$(which python 2>/dev/null) if pythonBin=$(which python 2>/dev/null)
@ -245,7 +259,10 @@ addPythonSupport()
# #
addMesaSupport() addMesaSupport()
{ {
[ "${withMESA:=false}" = true ] || return if [ "${withMESA:=false}" != true ]
then
return
fi
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ] if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
then then
@ -269,7 +286,10 @@ addMesaSupport()
addQtSupport() addQtSupport()
{ {
QtVersion=none QtVersion=none
[ "${withQT:=false}" = true ] || return if [ "${withQT:=false}" != true ]
then
return
fi
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON" addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
@ -328,10 +348,10 @@ addQtSupport()
QtMajor=$1 QtMajor=$1
QtMinor=$2 QtMinor=$2
if [[ ($QtMajor -lt 4) || ($QtMajor -eq 4 && $QtMinor -lt 5) ]] if [ $QtMajor -ne 4 -o $QtMajor -eq 4 -a $QtMinor -lt 5 ]
then then
echo "*** Error: Qt version provided < 4.5" echo "*** Error: Qt version provided < 4.5"
echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 " echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 and < 5.0"
echo "*** e.g." echo "*** e.g."
echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake" echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake"
echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake" echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake"
@ -383,7 +403,10 @@ configParaView()
fi fi
# default to using cmake from the path # default to using cmake from the path
[ -n "$cmakeExe" ] || cmakeExe=cmake if [ -z "$cmakeExe" ]
then
cmakeExe=cmake
fi
# remove any existing build folder and recreate # remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ] if [ -d $ParaView_BINARY_DIR ]
@ -436,7 +459,10 @@ makeParaView()
# remove lib if it is a link # remove lib if it is a link
# (how this was previously handled before 'make install' worked) # (how this was previously handled before 'make install' worked)
[ -L lib ] && rm lib 2>/dev/null if [ -L lib ]
then
rm lib 2>/dev/null
fi
} }

View File

@ -74,7 +74,10 @@ setDirs()
# #
setVersion() setVersion()
{ {
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}" if [ "$#" -ge 1 ]
then
ParaView_VERSION="${1##paraview-}"
fi
# The major version is "<digits>.<digits>" # The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \ ParaView_MAJOR=$(echo $ParaView_VERSION | \
@ -154,7 +157,10 @@ addCMakeVariable()
# #
addVerbosity() addVerbosity()
{ {
[ "$withVERBOSE" = true ] && addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE" if [ "${withVERBOSE:=false}" = true ]
then
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
fi
} }
@ -163,7 +169,11 @@ addVerbosity()
# #
addMpiSupport() addMpiSupport()
{ {
[ "${withMPI:=false}" = true ] || return if [ "${withMPI:=false}" != true ]
then
return
fi
OBJ_ADD="$OBJ_ADD-mpi" OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON" addCMakeVariable "PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON"
@ -176,7 +186,11 @@ addMpiSupport()
# #
addPythonSupport() addPythonSupport()
{ {
[ "${withPYTHON:=false}" = true ] || return if [ "${withPYTHON:=false}" != true ]
then
return
fi
OBJ_ADD="$OBJ_ADD-py" OBJ_ADD="$OBJ_ADD-py"
if pythonBin=$(which python 2>/dev/null) if pythonBin=$(which python 2>/dev/null)
@ -244,7 +258,10 @@ addPythonSupport()
# #
addMesaSupport() addMesaSupport()
{ {
[ "${withMESA:=false}" = true ] || return if [ "${withMESA:=false}" != true ]
then
return
fi
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ] if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
then then
@ -268,7 +285,11 @@ addMesaSupport()
addQtSupport() addQtSupport()
{ {
QtVersion=none QtVersion=none
[ "${withQT:=false}" = true ] || return
if [ "${withQT:=false}" != true ]
then
return
fi
addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON" addCMakeVariable "PARAVIEW_BUILD_QT_GUI=ON"
@ -327,10 +348,10 @@ addQtSupport()
QtMajor=$1 QtMajor=$1
QtMinor=$2 QtMinor=$2
if [ $QtMajor -lt 4 ] || [ $QtMajor -eq 4 -a $QtMinor -lt 5 ] if [ $QtMajor -lt 4 -o $QtMajor -eq 4 -a $QtMinor -lt 5 ]
then then
echo "*** Error: Qt version provided < 4.5" echo "*** Error: Qt version provided < 4.5"
echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5 " echo "*** Please use the -qmake option to specify the location of a version of Qt >= 4.5"
echo "*** e.g." echo "*** e.g."
echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake" echo "*** -qmake /usr/local/qt-4.6.2/bin/qmake"
echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake" echo "*** -qmake $installBASE/qt-4.6.2/bin/qmake"
@ -382,7 +403,10 @@ configParaView()
fi fi
# Default to using cmake from the path # Default to using cmake from the path
[ -n "$cmakeExe" ] || cmakeExe=cmake if [ -z "$cmakeExe" ]
then
cmakeExe=cmake
fi
# Remove any existing build folder and recreate # Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ] if [ -d $ParaView_BINARY_DIR ]
@ -438,7 +462,10 @@ makeParaView()
# Remove lib if it is a link # Remove lib if it is a link
# (how this was previously handled before 'make install' worked) # (how this was previously handled before 'make install' worked)
[ -L lib ] && rm lib 2>/dev/null if [ -L lib ]
then
rm lib 2>/dev/null
fi
} }

View File

@ -187,6 +187,11 @@ else
exit 1 exit 1
fi fi
if [ "$cgal_version" = "cgal-system" ]
then
echo "Using system installation of CGAL"
exit 0
fi
# #
# Build CGAL # Build CGAL