CMAKE: moved GNA var setting to proper place; removed find_package when build python...
[platform/upstream/dldt.git] / inference-engine / cmake / cppcheck.cmake
1 # Copyright (C) 2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
3 #
4
5 if(ENABLE_CPPCHECK)
6     find_program(CPPCHECK_EXECUTABLE cppcheck)
7
8     if(NOT CPPCHECK_EXECUTABLE)
9         message(WARNING "cppcheck was not found : disable static analysis")
10         set(ENABLE_CPPCHECK OFF)
11     endif()
12 endif()
13
14 function(add_cppcheck)
15     if(NOT ENABLE_CPPCHECK)
16         return()
17     endif()
18
19     set_property(
20         TARGET ${ARGN}
21         PROPERTY CXX_CPPCHECK
22             ${CPPCHECK_EXECUTABLE}
23             "--suppress=*:*/temp/*"
24             "--suppress=*:*/thirdparty/*"
25             "--error-exitcode=1"
26             "--template={file}:{line}: error: [cppcheck:{severity}] {message}"
27             "--quiet")
28 endfunction()