Compare commits
No commits in common. "83a9e94e31ab410c3346a36ddd2d10aa91375617" and "e5fbb9023546a5e98c832e8596586c71edcc5b2f" have entirely different histories.
83a9e94e31
...
e5fbb90235
@ -4,28 +4,22 @@ function(add_format_sources target)
|
|||||||
if(NOT TARGET format-sources)
|
if(NOT TARGET format-sources)
|
||||||
add_custom_target(format-sources)
|
add_custom_target(format-sources)
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET doc-add-comments)
|
|
||||||
add_custom_target(doc-add-comments)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_program(UNCRUSTIFY_EXE NAMES uncrustify)
|
find_program(UNCRUSTIFY_EXE NAMES uncrustify)
|
||||||
if(UNCRUSTIFY_EXE)
|
if(UNCRUSTIFY_EXE)
|
||||||
list(APPEND UNCRUSTIFY_OPTS -lCPP --replace --no-backup)
|
list(
|
||||||
|
APPEND
|
||||||
|
UNCRUSTIFY_OPTS
|
||||||
|
-lCPP
|
||||||
|
--replace
|
||||||
|
--no-backup
|
||||||
|
--mtime)
|
||||||
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
|
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
|
||||||
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
|
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
|
||||||
endif()
|
endif()
|
||||||
# cmake-format: off
|
|
||||||
add_custom_target(format-sources-uncrustify-${target} COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
|
add_custom_target(format-sources-uncrustify-${target} COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
|
||||||
--mtime ${_sources})
|
${_sources})
|
||||||
add_custom_target(doc-add-comments-uncrustify-${target} COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
|
|
||||||
--set cmt_insert_file_header=fileheader.txt
|
|
||||||
--set cmt_insert_file_footer=filefooter.txt
|
|
||||||
--set cmt_insert_func_header=funcheader.txt
|
|
||||||
--set cmt_insert_class_header=classheader.txt
|
|
||||||
--set cmt_insert_before_ctor_dtor=true ${_sources})
|
|
||||||
# cmake-format: on
|
|
||||||
add_dependencies(format-sources format-sources-uncrustify-${target})
|
add_dependencies(format-sources format-sources-uncrustify-${target})
|
||||||
add_dependencies(doc-add-comments doc-add-comments-uncrustify-${target})
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "CMLIB warning:")
|
message(STATUS "CMLIB warning:")
|
||||||
message(STATUS " uncrustify executable is not found")
|
message(STATUS " uncrustify executable is not found")
|
||||||
|
Loading…
Reference in New Issue
Block a user