]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: ensure that macro/function definitions are lowercase
authorMatthias Maier <tamiko@43-1.org>
Sat, 26 Nov 2022 15:51:40 +0000 (09:51 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 26 Nov 2022 22:52:11 +0000 (16:52 -0600)
contrib/utilities/lowercase_cmake

index d216d48712acd6f6b8d37093fac105d488644564..fb0dbdf77c5d89baff2dd0d2faea86ac93cb2b5e 100755 (executable)
@@ -47,10 +47,21 @@ collect_function_names | while read command ; do
 done > "${SED_FILE}"
 
 #
-# Add rules to ensure that else() and endif() do not contain a statement.
+# Add rules to ensure that else(), endif(), enmacro(), enfunction()
+# statements do not contain a parameter.
 #
-echo 's/else([^)]*)/else()/gI' > "${SED_FILE}"
-echo 's/endif([^)]*)/endif()/gI' > "${SED_FILE}"
+
+echo 's/else([^)]*)/else()/gI' >> "${SED_FILE}"
+echo 's/endif([^)]*)/endif()/gI' >> "${SED_FILE}"
+echo 's/endmacro([^)]*)/endmacro()/gI' >> "${SED_FILE}"
+echo 's/endfunction([^)]*)/endfunction()/gI' >> "${SED_FILE}"
+
+#
+# Add rules to ensure that all macro definitions are lowercase.
+#
+
+echo 's/macro\(\s*\)(\(\S*\)/macro\1(\L\2\E/gI' >> "${SED_FILE}"
+echo 's/function\(\s*\)(\(\S*\)/function\1(\L\2\E/gI' >> "${SED_FILE}"
 
 #
 # Apply rules file to all CMake files:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.