1.99.99
This commit is contained in:
@ -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)
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
5
MyxCMake/lib/uncrustify/classheader.txt
Normal file
5
MyxCMake/lib/uncrustify/classheader.txt
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @class $(fclass)
|
||||
* @brief TODO
|
||||
* @details TODO
|
||||
*/
|
1
MyxCMake/lib/uncrustify/filefooter.txt
Normal file
1
MyxCMake/lib/uncrustify/filefooter.txt
Normal file
@ -0,0 +1 @@
|
||||
// EOF $(filename)
|
6
MyxCMake/lib/uncrustify/fileheader.txt
Normal file
6
MyxCMake/lib/uncrustify/fileheader.txt
Normal file
@ -0,0 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* @file $(filename)
|
||||
* @brief TODO
|
||||
* @details TODO
|
||||
*/
|
5
MyxCMake/lib/uncrustify/funcheader.txt
Normal file
5
MyxCMake/lib/uncrustify/funcheader.txt
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @fn $(fclass)::$(function)
|
||||
* $(javaparam)
|
||||
* @details TODO
|
||||
*/
|
Reference in New Issue
Block a user