This commit is contained in:
Andrei Astafev 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
*/

View File

@ -3,7 +3,7 @@
## Установка
В корневом каталоге проекта создать каталог `cmake` и распаковать в него
[архив](../../../releases/download/1.99.98/myx-cmake-local-1.99.98.tar.xz ).
[архив](../../../releases/download/1.99.99/myx-cmake-local-1.99.99.tar.xz ).
## Использование

View File

@ -1 +1 @@
1.99.98
1.99.99

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(myx-cmake VERSION 1.99.98 LANGUAGES)
project(myx-cmake VERSION 1.99.99 LANGUAGES)
include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
myx-cmake (1.99.98) unstable; urgency=medium
myx-cmake (1.99.99) unstable; urgency=medium
* New version.

View File

@ -20,11 +20,11 @@ if(MYX_CMAKE_DIR)
set(ENV{MYX_CMAKE_DIR} ${MYX_CMAKE_DIR})
endif()
if(DEFINED ENV{MYX_CMAKE_DIR})
find_package(MyxCMake 1.99.98 REQUIRED CONFIG PATHS $ENV{MYX_CMAKE_DIR} NO_DEFAULT_PATH)
find_package(MyxCMake 1.99.99 REQUIRED CONFIG PATHS $ENV{MYX_CMAKE_DIR} NO_DEFAULT_PATH)
myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===")
else()
if(MYX_CMAKE_USE_SYSTEM)
find_package(MyxCMake 1.99.98 REQUIRED)
find_package(MyxCMake 1.99.99 REQUIRED)
myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===")
else()
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)