forked from ukaea/parallel-preprocessor
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFindClangFormat.cmake
More file actions
34 lines (29 loc) · 780 Bytes
/
FindClangFormat.cmake
File metadata and controls
34 lines (29 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Find Clang format
#
#
if(NOT CLANG_FORMAT_BIN_NAME)
set(CLANG_FORMAT_BIN_NAME clang-format)
endif()
# if custom path check there first
if(CLANG_FORMAT_ROOT_DIR)
find_program(CLANG_FORMAT_BIN
NAMES
${CLANG_FORMAT_BIN_NAME}
PATHS
"${CLANG_FORMAT_ROOT_DIR}"
NO_DEFAULT_PATH)
endif()
find_program(CLANG_FORMAT_BIN NAMES ${CLANG_FORMAT_BIN_NAME})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
CLANG_FORMAT
DEFAULT_MSG
CLANG_FORMAT_BIN)
mark_as_advanced(
CLANG_FORMAT_BIN)
if(CLANG_FORMAT_FOUND)
# A CMake script to find all source files and setup clang-format targets for them
include(clang-format)
else()
message("clang-format not found. Not setting up format targets")
endif()