This commit is contained in:
2022-11-27 07:09:09 +03:00
parent 4c1e54173d
commit 0cc415dc9d
7 changed files with 9 additions and 12 deletions

View File

@ -19,10 +19,7 @@ function(myx_uncrustify TARGET_NAME)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARG_CONFIG)
set(ARG_CONFIG "${PROJECT_SOURCE_DIR}/.uncrustify.cfg")
if(NOT EXISTS ${ARG_CONFIG})
set(ARG_CONFIG "${CMAKE_SOURCE_DIR}/.uncrustify.cfg")
endif()
set(ARG_CONFIG "${PROJECT_SOURCE_DIR}/uncrustify.cfg")
endif()
if(NOT EXISTS ${ARG_CONFIG})
@ -66,8 +63,8 @@ function(myx_uncrustify TARGET_NAME)
endif()
endforeach()
target_source(${TARGET_NAME} PRIVATE ${ARG_CONFIG})
set(__fixed_config ${PROJECT_BINARY_DIR}/uncrustify-${TARGET_NAME}.cfg)
add_custom_command(OUTPUT ${__fixed_config}
DEPENDS ${ARG_CONFIG}
COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc