File: port-cmake-style.sh

package info (click to toggle)
plasma-framework 5.28.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,168 kB
  • ctags: 3,945
  • sloc: cpp: 28,840; sh: 534; python: 477; ruby: 117; xml: 110; php: 27; makefile: 5
file content (10 lines) | stat: -rwxr-xr-x 499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
for FS in `find $PWD -type f -name 'CMakeLists.txt' -o -name '*.cmake'`; do
    #all commands should be lowercase
    #http://techbase.kde.org/Policies/CMake_Coding_Style#Upper.2Flower_casing
    perl -p -i -e 's/^( *)([0-9A-Z_]*)( *)\(/$1.lc($2).$3."("/ge' $FS

    #removes the predicate of endif and else in cmake
    # http://techbase.kde.org/Policies/CMake_Coding_Style#End_commands
    perl -p -i -e 's/endif( *)\(.*\)/endif\1()/g' $FS
    perl -p -i -e 's/else( *)\(.*\)/else\1()/g' $FS
done