File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.9.3
4
+ - Update to CPM 0.40.2
5
+ - Bugfix ` add_clang_format_target ` doesn't fail without ` clang-format `
6
+
3
7
## 0.9.2
4
8
- Update to CPM 0.40.1
5
9
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ if(NOT cpm.cmake_SOURCE_DIR)
15
15
FetchContent_Declare(
16
16
CPM.cmake
17
17
GIT_REPOSITORY "https://github.com/cpm-cmake/CPM.cmake.git"
18
- GIT_TAG v0.40.1 )
18
+ GIT_TAG v0.40.2 )
19
19
FetchContent_MakeAvailable(CPM.cmake)
20
20
include (${cpm.cmake_SOURCE_DIR }/cmake/CPM.cmake)
21
21
endif ()
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ function(add_clang_format_target TARGET)
26
26
set (MULTI_VALUE_KEYWORDS OPTIONS FILES )
27
27
cmake_parse_arguments (ARG "" "" "${MULTI_VALUE_KEYWORDS} " "${ARGN} " )
28
28
29
- find_program (CLANG_FORMAT_EXECUTABLE clang-format REQUIRED )
29
+ find_program (CLANG_FORMAT_EXECUTABLE clang-format)
30
30
31
- add_custom_target (
32
- ${TARGET}
33
- COMMAND ${CLANG_FORMAT_EXECUTABLE} ${ARG_OPTIONS} ${ARG_FILES}
34
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
35
- COMMENT "${CLANG_FORMAT_EXECUTABLE} ${ARG_OPTIONS} ${ARG_FILES} " )
31
+ if (CLANG_FORMAT_EXECUTABLE)
32
+ add_custom_target (
33
+ ${TARGET}
34
+ COMMAND ${CLANG_FORMAT_EXECUTABLE} ${ARG_OPTIONS} ${ARG_FILES}
35
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
36
+ COMMENT "${CLANG_FORMAT_EXECUTABLE} ${ARG_OPTIONS} ${ARG_FILES} " )
37
+ else ()
38
+ message (WARNING "clang-format not found, target ${TARGET} not created" )
39
+ endif ()
36
40
endfunction ()
You can’t perform that action at this time.
0 commit comments