From b3d19b7336bff8fee3281e1d63121ea6efb6dfc2 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 15 Oct 2022 10:12:14 +0300 Subject: [PATCH] 2.0.10 --- MyxxCMake/MyxxCMakeConfig.cmake | 1 + MyxxCMake/MyxxCMakeConfigVersion.cmake | 2 +- MyxxCMake/lib/AnalyzeClangTidy.cmake | 49 ++++++++++++++++++++++++++ README.md | 6 ++-- VERSION | 2 +- debian/CMakeLists.txt | 2 +- debian/changelog | 2 +- 7 files changed, 57 insertions(+), 7 deletions(-) diff --git a/MyxxCMake/MyxxCMakeConfig.cmake b/MyxxCMake/MyxxCMakeConfig.cmake index 69f8057..c53db17 100644 --- a/MyxxCMake/MyxxCMakeConfig.cmake +++ b/MyxxCMake/MyxxCMakeConfig.cmake @@ -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) diff --git a/MyxxCMake/MyxxCMakeConfigVersion.cmake b/MyxxCMake/MyxxCMakeConfigVersion.cmake index 238fbfb..25aacf8 100644 --- a/MyxxCMake/MyxxCMakeConfigVersion.cmake +++ b/MyxxCMake/MyxxCMakeConfigVersion.cmake @@ -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() diff --git a/MyxxCMake/lib/AnalyzeClangTidy.cmake b/MyxxCMake/lib/AnalyzeClangTidy.cmake index a0abb05..fa5a6bd 100644 --- a/MyxxCMake/lib/AnalyzeClangTidy.cmake +++ b/MyxxCMake/lib/AnalyzeClangTidy.cmake @@ -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() diff --git a/README.md b/README.md index f42c6c5..bfe1618 100644 --- a/README.md +++ b/README.md @@ -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`. ## Использование diff --git a/VERSION b/VERSION index 09843e3..0a69206 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.9 +2.0.10 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index 91fc6b6..702539c 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -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 diff --git a/debian/changelog b/debian/changelog index 1c29d85..4086a22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myxx-cmake (2.0.9) unstable; urgency=medium +myxx-cmake (2.0.10) unstable; urgency=medium * New version.