Commit e2332d6b authored by Mark OLESEN's avatar Mark OLESEN
Browse files

COMP: better handling of versioned cmake libraries

- sentinel was not working properly when building user-space routines
parent e27e5663
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Source CMake functions
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
cd ${0%/*} || exit 1 # Run from this directory
export WM_CONTINUE_ON_ERROR=true # Optional unit
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # Parse arguments
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
# -----------------------------------------------------------------------------
......
......@@ -46,21 +46,34 @@ then
exit 1
fi
for cmd in etags ctags-exuberant
unset etags
for cmd in ctags-exuberant etags
do
type $cmd >/dev/null 2>&1 || {
echo "${0##*/} cannot build tag files: '$cmd' command not found"
exit 1
}
command -v $cmd >/dev/null 2>&1 && { etags=$cmd; break; }
done
[ -n "$etags" ] || {
exec 1>&2
echo "${0##*/} cannot build tag files: no suitable command found"
echo " No ctags-exuberant"
echo " No etags"
exit 1
}
case "$etags" in
ctags-exuberant)
etags="$etags -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
;;
etags)
etags="$etags --declarations -l c++ -o .tags/etags -"
;;
esac
cd $WM_PROJECT_DIR || exit 1
mkdir .tags 2>/dev/null
#etagsCmd="etags --declarations -l c++ -o .tags/etags -"
etagsCmd="ctags-exuberant -e --extra=+fq --file-scope=no --c-kinds=+p -o .tags/etags -L -"
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etagsCmd
echo "building tags..." 1>&2
find -H $WM_PROJECT_DIR \( -name "*.[HC]" -o -name lnInclude -prune -o -name Doxygen -prune \) | $etags
#gtags -i --gtagsconf bin/tools/gtagsrc .tags
......
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source CMake functions
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
# -----------------------------------------------------------------------------
......@@ -23,7 +21,7 @@ if [ -n "$depend" ]
then
if [ "$targetType" != objects ]
then
if type cmake > /dev/null 2>&1
if command -v cmake > /dev/null 2>&1
then
cmakeVersioned "$depend" $PWD || {
echo
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -100,11 +100,9 @@ cmakeVersioned()
sentinel=$(sameDependency "$depend" "$sourceDir") || \
rm -rf "$objectsDir" > /dev/null 2>&1
mkdir -p $objectsDir && \
(
cd $objectsDir && _cmake $sourceDir && make \
&& echo "$depend" > ${sentinel:-/dev/null}
)
mkdir -p $objectsDir \
&& (cd $objectsDir && _cmake $sourceDir && make) \
&& echo "$depend" >| "${sentinel:-/dev/null}"
}
......
Supports Markdown
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