1#!/bin/sh 2 3cmakeFormat="cmake-format" 4 5path_to_cmake_format="$(which $cmakeFormat)" 6echo "$path_to_cmake_format" 7 8if [ -z "$cmakeFormat" ] 9then 10 echo "$cmakeFormat is not installed. Cannot format cmake files..." 11 echo "run: pip install cmake-format" 12 exit 1 13fi 14 15echo "$cmakeFormat was found, going to format your cmake scripts..." >&2 16 17find $(dirname "$0")/ \ 18-not \( -path "*/build/*" -prune \) \ 19\( -name *.cmake -o -name CMakeLists.txt \) \ 20| xargs $cmakeFormat -c cmake-format.yaml -i 21 22 23echo "done formatting with cmake-format" 24