-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
28 lines (24 loc) · 837 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
28 lines (24 loc) · 837 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
cmake_minimum_required(VERSION 3.15)
project(cesium-python VERSION 0.1.0 LANGUAGES CXX)
include(cmake/Dependencies.cmake)
add_subdirectory(csrc)
# Clang-format target for code formatting
file(GLOB_RECURSE ALL_SOURCE_FILES
"csrc/*.cpp"
"csrc/*.h"
)
find_program(CLANG_FORMAT_EXECUTABLE clang-format)
if(CLANG_FORMAT_EXECUTABLE)
add_custom_target(
format
COMMAND ${CLANG_FORMAT_EXECUTABLE} -i ${ALL_SOURCE_FILES}
COMMENT "Formatting code with clang-format (local .clang-format)"
)
add_custom_target(
format-check
COMMAND ${CLANG_FORMAT_EXECUTABLE} --dry-run -Werror ${ALL_SOURCE_FILES}
COMMENT "Checking code formatting with clang-format (local .clang-format)"
)
else()
message(WARNING "clang-format not found. Format targets will not be available.")
endif()