From 6a11f9b43d4253bcb3e29ab174cee35d5eb8a811 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 22 Dec 2021 10:33:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B0=D0=B9=D0=BB=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=B4=D0=BB=D1=8F=20uncrustify=20=D0=B0?= =?UTF-8?q?=D0=B4=D0=B0=D0=BF=D1=82=D0=B8=D1=80=D1=83=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=BA=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyxCMake/modules/MyxCMakeFormatSources.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MyxCMake/modules/MyxCMakeFormatSources.cmake b/MyxCMake/modules/MyxCMakeFormatSources.cmake index 782e02a..0b83440 100644 --- a/MyxCMake/modules/MyxCMakeFormatSources.cmake +++ b/MyxCMake/modules/MyxCMakeFormatSources.cmake @@ -18,15 +18,22 @@ function(myx_cmake_format_sources target) endif() if(EXISTS ${CMAKE_SOURCE_DIR}/.uncrustify.cfg) - list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg) + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/uncrustify.cfg + COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc + -c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg + -o ${CMAKE_BINARY_DIR}/uncrustify.cfg) + list(APPEND UNCRUSTIFY_OPTS -L ERR -c ${CMAKE_BINARY_DIR}/uncrustify.cfg) endif() # cmake-format: off add_custom_target(${target}-check-format-sources-uncrustify + DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources}) list(APPEND UNCRUSTIFY_OPTS --replace --no-backup) add_custom_target(${target}-format-sources-uncrustify + DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources}) add_custom_target(${target}-add-doxygen-comments-uncrustify + DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --set cmt_insert_file_header=fileheader.txt --set cmt_insert_file_footer=filefooter.txt