From 4bd8ab0ceda02914c4abdee01266e3bdc6a099dd Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 22 Apr 2020 08:33:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A6=D0=B5=D0=BB=D1=8C=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B5=D0=B2=20=D0=B2=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B5=20Doxygen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibFormatSources.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMLibFormatSources.cmake b/CMLibFormatSources.cmake index 8c1ea81..2c25b81 100644 --- a/CMLibFormatSources.cmake +++ b/CMLibFormatSources.cmake @@ -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})