| # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) |
| # SPDX-License-Identifier: BSD-2-Clause |
| # Style an input list of files as cmake files. |
| # Pass the cmake format as args such that cmake-format.py can be used |
| # to provide definitions for custom function formatting. |
| CMAKE_FMT="--line-width 100 \ |
| --max-subargs-per-line 3 \ |
| --separate-ctrl-name-with-space False \ |
| --separate-fn-name-with-space False \ |
| --command-case unchanged \ |
| --keyword-case unchanged \ |
| # cmake-format sends its version info to standard error. :-/ |
| CF_VERSION=$(cmake-format --version 2>&1) |
| echo "$PROGNAME: fatal error: no output from \"cmake-format --version\"" |
| echo "$PROGNAME: fatal error: need version $DESIRED_VERSION of" \ |
| "cmake-format; $CF_VERSION is installed" |
| cmake-format -i $CMAKE_FMT "$@" |