Adding upstream version 2.0.24.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e508fcfeb9
commit
afb0a8fea7
118 changed files with 45084 additions and 0 deletions
32
CMakeModules/SourceFormat.cmake
Normal file
32
CMakeModules/SourceFormat.cmake
Normal file
|
@ -0,0 +1,32 @@
|
|||
# format source files with uncrustify
|
||||
|
||||
# check that format checking is available - always use before SOURCE_FORMAT
|
||||
macro(SOURCE_FORMAT_ENABLE)
|
||||
find_package(Uncrustify 0.71)
|
||||
if(UNCRUSTIFY_FOUND)
|
||||
set(SOURCE_FORMAT_ENABLED TRUE)
|
||||
else()
|
||||
set(SOURCE_FORMAT_ENABLED FALSE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# files are expected to be a list and relative paths are resolved wtih respect to CMAKE_SOURCE DIR
|
||||
macro(SOURCE_FORMAT)
|
||||
if(NOT ${ARGC})
|
||||
message(FATAL_ERROR "source_format() needs a list of files to format!")
|
||||
endif()
|
||||
|
||||
if(SOURCE_FORMAT_ENABLED)
|
||||
add_custom_target(format
|
||||
COMMAND ${UNCRUSTIFY} -c ${CMAKE_SOURCE_DIR}/uncrustify.cfg --no-backup --replace ${ARGN}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Formating sources with ${UNCRUSTIFY} ...")
|
||||
|
||||
add_custom_target(format-check
|
||||
COMMAND ${UNCRUSTIFY} -c ${CMAKE_SOURCE_DIR}/uncrustify.cfg --check ${ARGN}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Checking format of the sources with ${UNCRUSTIFY} ...")
|
||||
|
||||
set(SOURCE_FORMAT_ENABLED TRUE)
|
||||
endif()
|
||||
endmacro()
|
Loading…
Add table
Add a link
Reference in a new issue