File: Format.cmake

package info (click to toggle)
cmake-vala 3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 224 kB
  • sloc: makefile: 4
file content (16 lines) | stat: -rw-r--r-- 355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# additional target to perform clang-format run, requires clang-format

# get all project files
function(use_format)
	find_program(CLANG_FORMAT clang-format)
	file(GLOB_RECURSE ALL_SOURCE_FILES *.c *.h)
	add_custom_target(
		    clangformat
		    COMMAND ${CLANG_FORMAT}
		    -style=file
		    -i
		    ${ALL_SOURCE_FILES}
	)
endfunction()

use_format()