This commit is contained in:
2022-10-04 10:08:19 +03:00
parent 45ca72b363
commit 79c12f1827
4 changed files with 13 additions and 9 deletions

View File

@ -46,11 +46,9 @@ function(myx_uncrustify target)
if(NOT ARG_CONFIG)
set(ARG_CONFIG "${PROJECT_SOURCE_DIR}/.uncrustify.cfg")
endif()
if(NOT UNCRUSTIFY_EXE)
myx_message_notify("MyxCMake: uncrustify executable is not found")
return()
if(NOT EXISTS ${ARG_CONFIG})
set(ARG_CONFIG "${CMAKE_SOURCE_DIR}/.uncrustify.cfg")
endif()
endif()
if(NOT EXISTS ${ARG_CONFIG})
@ -58,6 +56,11 @@ function(myx_uncrustify target)
return()
endif()
if(NOT UNCRUSTIFY_EXE)
myx_message_notify("MyxCMake: uncrustify executable is not found")
return()
endif()
if(NOT TARGET myx-uncrustify)
add_custom_target(myx-uncrustify)
endif()
@ -72,6 +75,7 @@ function(myx_uncrustify target)
list(FILTER __sources EXCLUDE REGEX "qrc_.*\\.cpp$")
list(FILTER __sources EXCLUDE REGEX "moc_.*\\.cpp$")
list(FILTER __sources EXCLUDE REGEX "ui_.*\\.h$")
list(FILTER __sources EXCLUDE REGEX ".*\\.qm$")
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-${target}.cfg
COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc