This commit is contained in:
Andrei Astafev 2022-10-15 10:12:14 +03:00
parent 54f8cfc1cc
commit b3d19b7336
7 changed files with 57 additions and 7 deletions

View File

@ -47,6 +47,7 @@ function(myxx)
)
myxx_code_coverage(${iter})
myxx_analyze_clang_tidy(${iter})
myxx_analyze_clang_tidy_naming(${iter})
myxx_analyze_clang_check(${iter})
if(MYXX_CMAKE_CLAZY_FIX)
myxx_analyze_clazy(${iter} FIX)

View File

@ -1,4 +1,4 @@
set(MYXX_CMAKE_PACKAGE_VERSION "2.0.9")
set(MYXX_CMAKE_PACKAGE_VERSION "2.0.10")
if(MYXX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

View File

@ -52,3 +52,52 @@ function(myxx_analyze_clang_tidy TARGET_NAME)
add_dependencies(${TARGET_NAME}-analyze-clang-tidy ${TARGET_NAME})
add_dependencies(myxx-analyze-clang-tidy ${TARGET_NAME}-analyze-clang-tidy)
endfunction()
function(myxx_analyze_clang_tidy_naming TARGET_NAME)
myx_skip_external_target(${TARGET_NAME})
if(NOT CLANG_TIDY_EXE)
message(STATUS "MyxxCMake: Clang Tidy analyzer is not found")
return()
endif()
set(options FIX)
set(oneValueArgs CONFIG)
set(multiValueArgs EXTRA_ARGS)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARG_CONFIG)
set(ARG_CONFIG ${PROJECT_SOURCE_DIR}/.clang-tidy-naming)
endif()
if(NOT EXISTS ${ARG_CONFIG})
return()
endif()
if(TARGET ${TARGET_NAME}-analyze-clang-tidy-naming)
message(STATUS "MyxxCMake: target ${TARGET_NAME}-analyze-clang-tidy-naming already exists")
return()
endif()
set(__cmd_args -extra-arg="-Wno-unknown-warning-option ${ARG_EXTRA_ARGS}")
get_target_property(__sources ${TARGET_NAME} SOURCES)
foreach(iter ${__sources})
string(FIND ${iter} ${CMAKE_BINARY_DIR} pos)
if(pos EQUAL -1)
list(APPEND __filtered_sources ${iter})
endif()
endforeach()
if(ARG_FIX)
list(APPEND __cmd_args "-fix-errors")
endif()
if(NOT TARGET myxx-analyze-clang-tidy-naming)
add_custom_target(myxx-analyze-clang-tidy-naming)
endif()
add_custom_target(${TARGET_NAME}-analyze-clang-tidy-naming
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CLANG_TIDY_EXE} ${__cmd_args} -p ${CMAKE_BINARY_DIR} ${__filtered_sources})
add_dependencies(${TARGET_NAME}-analyze-clang-tidy-naming ${TARGET_NAME})
add_dependencies(myxx-analyze-clang-tidy-naming ${TARGET_NAME}-analyze-clang-tidy-naming)
endfunction()

View File

@ -2,9 +2,9 @@
## Установка
Скачать [пакет](../../../releases/download/2.0.9/myxx-cmake_2.0.9_all.deb)
для Debian и установить его, выполнив команду `sudo dpkg -i myxx-cmake_2.0.9_all.deb`,
или [архив](../../../releases/download/2.0.9/myxx-cmake-local-2.0.9.tar.xz)
Скачать [пакет](../../../releases/download/2.0.10/myxx-cmake_2.0.10_all.deb)
для Debian и установить его, выполнив команду `sudo dpkg -i myxx-cmake_2.0.10_all.deb`,
или [архив](../../../releases/download/2.0.10/myxx-cmake-local-2.0.10.tar.xz)
и распаковать его в каталог `$HOME/.local/share/cmake`.
## Использование

View File

@ -1 +1 @@
2.0.9
2.0.10

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(myxx-cmake VERSION 2.0.9 LANGUAGES)
project(myxx-cmake VERSION 2.0.10 LANGUAGES)
include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxxCMake/MyxxCMakeConfigVersion.cmake

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
myxx-cmake (2.0.9) unstable; urgency=medium
myxx-cmake (2.0.10) unstable; urgency=medium
* New version.