Путь к файлу настройки uncrustify внутри проекта

This commit is contained in:
Andrei Astafev 2019-07-20 11:39:42 +03:00
parent a34958e578
commit f4ea735208

View File

@ -8,8 +8,12 @@ function(add_uncrustify_format)
if(NOT TARGET uncrustify-format) if(NOT TARGET uncrustify-format)
add_custom_target(uncrustify-format) add_custom_target(uncrustify-format)
endif() endif()
list(APPEND OPTS -lCPP --replace --no-backup)
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
list(APPEND OPTS -c ${CMAKE_SOURCE_DIR}/cmake/etc/uncrustify/default.cfg)
endif()
add_custom_target(uncrustify-format-${_target} add_custom_target(uncrustify-format-${_target}
COMMAND ${UNCRUSTIFY_EXE} -lCPP --replace --no-backup ${_sources}) COMMAND ${UNCRUSTIFY_EXE} ${OPTS} ${_sources})
add_dependencies(uncrustify-format uncrustify-format-${_target}) add_dependencies(uncrustify-format uncrustify-format-${_target})
else() else()
message(WARNING "Uncrustify is not found") message(WARNING "Uncrustify is not found")