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
This commit is contained in:
mark
2017-02-01 17:41:48 +00:00
parent 1189ff23c9
commit 493d4b01ac

View File

@ -26,7 +26,10 @@
# makeCmake # makeCmake
# #
# Description # 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 # NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
@ -50,6 +53,7 @@ usage() {
usage: ${0##*/} [OPTION] cmake-VERSION usage: ${0##*/} [OPTION] cmake-VERSION
options: options:
-gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX -gcc Force gcc/g++ instead of the values from \$WM_CC, \$WM_CXX
-link Create additional symlink as 'cmake-system'
-help -help
* build cmake * build cmake
@ -63,6 +67,7 @@ USAGE
[ -n "$WM_CC" ] && export CC="$WM_CC" [ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX" [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
unset optLink
# Parse options # Parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -74,6 +79,9 @@ do
export CC=gcc # use gcc/g++ export CC=gcc # use gcc/g++
export CXX=g++ export CXX=g++
;; ;;
-link)
optLink=true
;;
cmake-[1-9]*) cmake-[1-9]*)
cmakePACKAGE="${1%%/}" cmakePACKAGE="${1%%/}"
;; ;;
@ -86,6 +94,11 @@ done
[ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified" [ -n "$cmakePACKAGE" ] || die "The cmake-VERSION was not specified"
if _foamIsSystem "$cmakePACKAGE"
then
unset optLink # basic sanity - cannot
fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Build CMAKE # Build CMAKE
@ -121,4 +134,19 @@ else
} }
fi 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------