Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Allow using system astyle
- Loading branch information
Showing
with
11 additions
and
4 deletions.
-
+11
−4
scripts/astyle.sh
|
@@ -14,16 +14,23 @@ |
|
|
# # |
|
|
########################################################################### |
|
|
|
|
|
for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle |
|
|
min_version="3.0.0" |
|
|
astyle_version_check() { |
|
|
[ `printf "$($1 --version | cut -d ' ' -f4)\n$min_version" | sort -V | head -n1` = "$min_version" ] |
|
|
} |
|
|
|
|
|
for ASTYLE in ${QGISSTYLE} $(dirname $0)/qgisstyle $(dirname $0)/RelWithDebInfo/qgisstyle astyle |
|
|
do |
|
|
if type -p $ASTYLE >/dev/null; then |
|
|
break |
|
|
if type -p $ASTYLE >/dev/null ; then |
|
|
if astyle_version_check $ASTYLE ; then |
|
|
break |
|
|
fi |
|
|
fi |
|
|
ASTYLE= |
|
|
done |
|
|
|
|
|
if [ -z "$ASTYLE" ]; then |
|
|
echo "qgisstyle not found - please enable WITH_ASTYLE in cmake and build it" >&2 |
|
|
echo "qgisstyle / astyle not found - please install astyle >= $min_version or enable WITH_ASTYLE in cmake and build" >&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|