From cdfe022922ca8c9f503c371776a7ac83f80fcb0d Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 13 Dec 2021 16:21:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=86=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=B4=D0=BB=D1=8F=20=D0=B0=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- .../modules/MyxCMakeCodeAnalyzeClangCheck.cmake | 12 ++++++------ .../modules/MyxCMakeCodeAnalyzeClangTidy.cmake | 12 ++++++------ MyxCMake/modules/MyxCMakeCodeAnalyzeClazy.cmake | 14 +++++++------- .../modules/MyxCMakeCodeAnalyzePvsStudio.cmake | 10 +++++----- .../modules/MyxCMakeCommonTargetProperties.cmake | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8ff513..07cfe35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0) -project(myx-cmake VERSION 0.3.2 LANGUAGES) +project(myx-cmake VERSION 0.3.3 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/MyxCMake/modules/MyxCMakeCodeAnalyzeClangCheck.cmake b/MyxCMake/modules/MyxCMakeCodeAnalyzeClangCheck.cmake index 5c6a567..6bb009d 100644 --- a/MyxCMake/modules/MyxCMakeCodeAnalyzeClangCheck.cmake +++ b/MyxCMake/modules/MyxCMakeCodeAnalyzeClangCheck.cmake @@ -10,7 +10,7 @@ endif() unset(V) unset(CLANG_CHECK_NAMES) -function(myx_cmake_clang_check_analyze target) +function(myx_cmake_analyze_clang_check target) if(CLANG_CHECK_EXE) set(_args --analyze --extra-arg="-Wno-unknown-warning-option") get_target_property(__sources ${target} SOURCES) @@ -21,13 +21,13 @@ function(myx_cmake_clang_check_analyze target) if(MYX_CMAKE_CLANG_ANALYZE_FIX) list(APPEND _args "--fixit") endif() - if(NOT TARGET myx-cmake-clang-check-analyze) - add_custom_target(myx-cmake-clang-check-analyze) + if(NOT TARGET myx-cmake-analyze-clang-check) + add_custom_target(myx-cmake-analyze-clang-check) endif() - add_custom_target(${target}-clang-check-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + add_custom_target(${target}-analyze-clang-check WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CLANG_CHECK_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources}) - add_dependencies(${target}-clang-check-analyze ${target}) - add_dependencies(myx-cmake-clang-check-analyze ${target}-clang-check-analyze) + add_dependencies(${target}-analyze-clang-check ${target}) + add_dependencies(myx-cmake-analyze-clang-check ${target}-analyze-clang-check) else() message(STATUS "MyxCMake: Clang Check analyzer is not found") endif() diff --git a/MyxCMake/modules/MyxCMakeCodeAnalyzeClangTidy.cmake b/MyxCMake/modules/MyxCMakeCodeAnalyzeClangTidy.cmake index 94d3d01..ce3a2f9 100644 --- a/MyxCMake/modules/MyxCMakeCodeAnalyzeClangTidy.cmake +++ b/MyxCMake/modules/MyxCMakeCodeAnalyzeClangTidy.cmake @@ -10,7 +10,7 @@ endif() unset(V) unset(CLANG_TIDY_NAMES) -function(myx_cmake_clang_tidy_analyze target) +function(myx_cmake_analyze_clang_tidy target) if(CLANG_TIDY_EXE) set(_args -extra-arg="-Wno-unknown-warning-option") get_target_property(__sources ${target} SOURCES) @@ -21,13 +21,13 @@ function(myx_cmake_clang_tidy_analyze target) if(MYX_CMAKE_CLANG_TIDY_FIX) list(APPEND _args "--fix") endif() - if(NOT TARGET myx-cmake-clang-tidy-analyze) - add_custom_target(myx-cmake-clang-tidy-analyze) + if(NOT TARGET myx-cmake-analyze-clang-tidy) + add_custom_target(myx-cmake-analyze-clang-tidy) endif() - add_custom_target(${target}-clang-tidy-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + add_custom_target(${target}-analyze-clang-tidy WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CLANG_TIDY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources}) - add_dependencies(${target}-clang-tidy-analyze ${target}) - add_dependencies(myx-cmake-clang-tidy-analyze ${target}-clang-tidy-analyze) + add_dependencies(${target}-analyze-clang-tidy ${target}) + add_dependencies(myx-cmake-analyze-clang-tidy ${target}-analyze-clang-tidy) else() message(STATUS "MyxCMake: Clang Tidy analyzer is not found") endif() diff --git a/MyxCMake/modules/MyxCMakeCodeAnalyzeClazy.cmake b/MyxCMake/modules/MyxCMakeCodeAnalyzeClazy.cmake index 7527617..ae6c007 100644 --- a/MyxCMake/modules/MyxCMakeCodeAnalyzeClazy.cmake +++ b/MyxCMake/modules/MyxCMakeCodeAnalyzeClazy.cmake @@ -16,7 +16,7 @@ if(CLAZY_EXE AND CLANG_APPLY_REPLACEMENTS_EXE) option(MYX_CMAKE_CLAZY_FIX "MyxCMake: perform fixes for Clazy" OFF) endif() -function(myx_cmake_clazy_analyze target) +function(myx_cmake_analyze_clazy target) if(CLAZY_EXE) set(options) set(oneValueArgs CHECKS) @@ -34,21 +34,21 @@ function(myx_cmake_clazy_analyze target) set(_args -checks=${ARG_CHECKS} -extra-arg="-Wno-unknown-warning-option" -export-fixes=clazy-fixes-file.yaml) - if(NOT TARGET myx-cmake-clazy-analyze) - add_custom_target(myx-cmake-clazy-analyze) + if(NOT TARGET myx-cmake-analyze-clazy) + add_custom_target(myx-cmake-analyze-clazy) endif() if(MYX_CMAKE_CLAZY_FIX) add_custom_target( - ${target}-clazy-analyze + ${target}-analyze-clazy WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources} COMMAND ${CLANG_APPLY_REPLACEMENTS_EXE} ${CMAKE_BINARY_DIR}) else() - add_custom_target(${target}-clazy-analyze WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + add_custom_target(${target}-analyze-clazy WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${__sources}) endif() - add_dependencies(${target}-clazy-analyze ${target}) - add_dependencies(myx-cmake-clazy-analyze ${target}-clazy-analyze) + add_dependencies(${target}-analyze-clazy ${target}) + add_dependencies(myx-cmake-analyze-clazy ${target}-analyze-clazy) else() message(STATUS "MyxCMake: Clazy standalone analyzer is not found") endif() diff --git a/MyxCMake/modules/MyxCMakeCodeAnalyzePvsStudio.cmake b/MyxCMake/modules/MyxCMakeCodeAnalyzePvsStudio.cmake index 7f084e6..1756389 100644 --- a/MyxCMake/modules/MyxCMakeCodeAnalyzePvsStudio.cmake +++ b/MyxCMake/modules/MyxCMakeCodeAnalyzePvsStudio.cmake @@ -4,11 +4,11 @@ else() message(STATUS "MyxCMake: CMAKE_EXPORT_COMPILE_COMMANDS is not set. PVS checks will be disabled.") endif() -function(myx_cmake_pvs_studio_analyze target) +function(myx_cmake_analyze_pvs_studio target) set(options) set(oneValueArgs CHECKS) set(multiValueArgs) - if(NOT TARGET myx-cmake-pvs-studio-analyze) + if(NOT TARGET myx-cmake-analyze-pvs-studio) set(PVS_STUDIO_HEADER "${CMAKE_BINARY_DIR}/include/myx_cmake_pvs_studio_header.hpp") file(WRITE ${PVS_STUDIO_HEADER} "#ifndef MYX_CMAKE_PVS_STUDIO_HEADER_HPP_\n" @@ -17,7 +17,7 @@ function(myx_cmake_pvs_studio_analyze target) "//-V813_MINSIZE=33\n" "#endif // MYX_CMAKE_PVS_STUDIO_HEADER_HPP_\n") - pvs_studio_add_target(TARGET myx-cmake-pvs-studio-analyze + pvs_studio_add_target(TARGET myx-cmake-analyze-pvs-studio CONFIG ${PVS_STUDIO_CONFIG} DEPENDS ${PVS_STUDIO_CONFIG} COMPILE_COMMANDS @@ -39,8 +39,8 @@ function(myx_cmake_pvs_studio_analyze target) endif() endif() - if(EXISTS PVS_STUDIO_BIN_PATH AND EXISTS PVS_STUDIO_CONVERTER_PATH AND TARGET myx-cmake-pvs-studio-analyze) - add_dependencies(myx-cmake-pvs-studio-analyze ${target}) + if(EXISTS PVS_STUDIO_BIN_PATH AND EXISTS PVS_STUDIO_CONVERTER_PATH AND TARGET myx-cmake-analyze-pvs-studio) + add_dependencies(myx-cmake-analyze-pvs-studio ${target}) get_target_property(__target_source_dir "${target}" SOURCE_DIR) pvs_studio_analyze_target("${target}" "${__target_source_dir}") endif() diff --git a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake index 4466939..70210fb 100644 --- a/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake +++ b/MyxCMake/modules/MyxCMakeCommonTargetProperties.cmake @@ -123,10 +123,10 @@ function(myx_cmake_common_target_properties target) ${target} ${__visibility} "MYX_CMAKE_LSB_CODENAME_${MYX_CMAKE_LSB_CODENAME}") - myx_cmake_clang_tidy_analyze(${target}) - myx_cmake_clang_check_analyze(${target}) - myx_cmake_clazy_analyze(${target}) - myx_cmake_pvs_studio_analyze(${target}) + myx_cmake_analyze_clang_tidy(${target}) + myx_cmake_analyze_clang_check(${target}) + myx_cmake_analyze_clazy(${target}) + myx_cmake_analyze_pvs_studio(${target}) myx_cmake_format_sources(${target}) # Создание в каталоге ${CMAKE_BINARY_DIR} стандартных каталогов bin,include,lib