Commit 493d4b01 authored by mark's avatar mark
Browse files

ENH: provide -link option for makeCmake

- this creates a cmake-system link to the given cmake version, which
  is a simple means of providing an updated cmake version for the
  OpenFOAM build without actually needing to edit the
  etc/config.sh/paraview file
parent 1189ff23
......@@ -26,7 +26,10 @@
# makeCmake
#
# Description
# Build script for cmake
# Build script for cmake.
#
# The '-link' option can be used to create a 'cmake-system' pointing
# to this version.
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
......@@ -50,6 +53,7 @@ usage() {
usage: ${0##*/} [OPTION] cmake-VERSION
options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-link Create additional symlink as 'cmake-system'
-help
* build cmake
......@@ -63,6 +67,7 @@ USAGE
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
unset optLink
# Parse options
while [ "$#" -gt 0 ]
do
......@@ -74,6 +79,9 @@ do
export CC=gcc # use gcc/g++
export CXX=g++
;;
-link)
optLink=true
;;
cmake-[1-9]*)
cmakePACKAGE="${1%%/}"
;;
......@@ -86,6 +94,11 @@ done
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
if _foamIsSystem "$cmakePACKAGE"
then
unset optLink # basic sanity - cannot
fi
#------------------------------------------------------------------------------
#
# Build CMAKE
......@@ -121,4 +134,19 @@ else
}
fi
if [ "$optLink" = true -a -x "$CMAKE_ARCH_PATH/bin/cmake" ]
then
(
cd ${CMAKE_ARCH_PATH%/*} || exit 1
if [ -L cmake-system ]
then
rm cmake-system
elif [ -d cmake-system ]
then
exit 2
fi
ln -svf $cmakePACKAGE cmake-system
)
fi
#------------------------------------------------------------------------------
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