This commit is contained in:
2022-10-06 15:14:38 +03:00
parent bd8ed5e679
commit 900bfe307b
12 changed files with 39 additions and 48 deletions

View File

@ -41,7 +41,7 @@ include(${MYX_CMAKE_LIB_DIR}/AddLibrary.cmake)
include(${MYX_CMAKE_LIB_DIR}/TargetSetup.cmake)
include(${MYX_CMAKE_LIB_DIR}/Qt5TargetSetup.cmake)
include(${MYX_CMAKE_LIB_DIR}/Uncrustify.cmake)
include(${MYX_CMAKE_LIB_DIR}/uncrustify/Uncrustify.cmake)
include(${MYX_CMAKE_LIB_DIR}/doc/Doxygen.cmake)
include(${MYX_CMAKE_LIB_DIR}/generators/PrivateConfigHeader.cmake)

View File

@ -1,4 +1,4 @@
set(MYX_CMAKE_PACKAGE_VERSION "1.99.98")
set(MYX_CMAKE_PACKAGE_VERSION "1.99.99")
if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

View File

@ -1,47 +1,19 @@
include_guard(GLOBAL)
if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
set(MYX_CMAKE_LIB_UNCRUSTIFY_DIR_BACKPORT "${CMAKE_CURRENT_LIST_DIR}")
endif()
find_program(UNCRUSTIFY_EXE NAMES uncrustify)
if(UNCRUSTIFY_EXE)
if(NOT EXISTS ${PROJECT_BINARY_DIR}/uncrustify-classheader.txt)
file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-classheader.txt CONTENT
"/**
* @class $(fclass)
* @brief TODO
* @details TODO
*/")
endif()
if(NOT EXISTS ${PROJECT_BINARY_DIR}/uncrustify-filefooter.txt)
file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-filefooter.txt CONTENT
"// EOF $(filename)")
endif()
if(NOT EXISTS ${PROJECT_BINARY_DIR}/uncrustify-fileheader.txt)
file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-fileheader.txt CONTENT
"/**
* @file $(filename)
* @brief TODO
* @details TODO
*/")
endif()
if(NOT EXISTS ${PROJECT_BINARY_DIR}/uncrustify-funcheader.txt)
file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/uncrustify-funcheader.txt CONTENT
"/**
* @fn $(fclass)::$(function)
* $(javaparam)
* @details TODO
*/")
endif()
endif()
function(myx_uncrustify target)
if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
set(CMAKE_CURRENT_FUNCTION_LIST_DIR ${MYX_CMAKE_LIB_UNCRUSTIFY_DIR_BACKPORT})
endif()
set(options)
set(oneValueArgs CONFIG)
set(multiValueArgs)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARG_CONFIG)
@ -61,6 +33,8 @@ function(myx_uncrustify target)
return()
endif()
if(NOT TARGET myx-uncrustify)
add_custom_target(myx-uncrustify)
endif()
@ -97,10 +71,10 @@ function(myx_uncrustify target)
add_custom_target(${target}-uncrustify-append-comments
DEPENDS ${PROJECT_BINARY_DIR}/uncrustify-${target}.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
--set cmt_insert_class_header=${PROJECT_BINARY_DIR}/uncrustify-classheader.txt
--set cmt_insert_file_footer=${PROJECT_BINARY_DIR}/uncrustify-filefooter.txt
--set cmt_insert_file_header=${PROJECT_BINARY_DIR}/uncrustify-fileheader.txt
--set cmt_insert_func_header=${PROJECT_BINARY_DIR}/uncrustify-funcheader.txt
--set cmt_insert_class_header=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/classheader.txt
--set cmt_insert_file_footer=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/filefooter.txt
--set cmt_insert_file_header=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/fileheader.txt
--set cmt_insert_func_header=${CMAKE_CURRENT_FUNCTION_LIST_DIR}/funcheader.txt
--set cmt_insert_before_ctor_dtor=true --mtime ${src})
# cmake-format: on

View File

@ -0,0 +1,5 @@
/**
* @class $(fclass)
* @brief TODO
* @details TODO
*/

View File

@ -0,0 +1 @@
// EOF $(filename)

View File

@ -0,0 +1,6 @@
// -*- C++ -*-
/**
* @file $(filename)
* @brief TODO
* @details TODO
*/

View File

@ -0,0 +1,5 @@
/**
* @fn $(fclass)::$(function)
* $(javaparam)
* @details TODO
*/