1 # Copyright (C) 2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
6 find_program(CPPCHECK_EXECUTABLE cppcheck)
8 if(NOT CPPCHECK_EXECUTABLE)
9 message(WARNING "cppcheck was not found : disable static analysis")
10 set(ENABLE_CPPCHECK OFF)
14 function(add_cppcheck)
15 if(NOT ENABLE_CPPCHECK)
22 ${CPPCHECK_EXECUTABLE}
23 "--suppress=*:*/temp/*"
24 "--suppress=*:*/thirdparty/*"
26 "--template={file}:{line}: error: [cppcheck:{severity}] {message}"