Цель для автоматического добавления комментариев в формате Doxygen

This commit is contained in:
Andrei Astafev 2020-04-22 08:33:57 +03:00
parent e5fbb90235
commit 4bd8ab0ced

View File

@ -12,10 +12,18 @@ function(add_format_sources target)
UNCRUSTIFY_OPTS
-lCPP
--replace
--no-backup
--mtime)
--no-backup)
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/comments.cfg)
if(NOT TARGET doc-add-comments)
add_custom_target(doc-add-comments)
endif()
set(COMMENTS_OPTS ${UNCRUSTIFY_OPTS} -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/comments.cfg)
add_custom_target(doc-add-comments-uncrustify-${target} COMMAND ${UNCRUSTIFY_EXE} ${COMMENTS_OPTS}
${_sources})
add_dependencies(doc-add-comments doc-add-comments-uncrustify-${target})
endif()
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 --mtime -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
endif()
add_custom_target(format-sources-uncrustify-${target} COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
${_sources})