cmlib/CMLibCodeAnalysisPvsStudio.cmake

20 lines
528 B
CMake
Raw Normal View History

2019-02-15 21:00:53 +00:00
option(USE_PVS_STUDIO "Use PVS-Studio for static analysis" OFF)
if(USE_PVS_STUDIO)
2019-02-19 07:53:12 +00:00
include(3rdparty/PVS-Studio)
2019-02-15 21:00:53 +00:00
find_program(PVS_STUDIO_ANALYZER_EXE NAMES pvs-studio-analyzer)
if(PVS_STUDIO_ANALYZER_EXE AND NOT TARGET pvs-global-checker)
pvs_studio_add_target(TARGET pvs-global-checker
ALL
RECURSIVE
HIDE_HELP
COMPILE_COMMANDS
OUTPUT FORMAT errorfile
MODE GA:1,2,3;64:1;OP:1,2;CS:1,2
LOG target.err)
else()
message(WARNING "PVS-Studio is not found")
endif()
endif()