1 # Copyright (C) 2018-2019 Intel Corporation
2 # SPDX-License-Identifier: Apache-2.0
5 if(EXISTS "${REPORT_DIR}")
6 file(REMOVE_RECURSE "${REPORT_DIR}")
9 file(MAKE_DIRECTORY "${REPORT_DIR}")
13 "${PYTHON_EXECUTABLE}"
15 "--file=${INPUT_FILE}"
16 "--report-dir=${REPORT_DIR}"
17 "--source-dir=${SOURCE_DIR}"
20 # Change cppcheck things to cpplint
22 file(READ "${REPORT_DIR}/index.html" cur_file_content)
24 string(REPLACE "Cppcheck" "cpplint" cur_file_content "${cur_file_content}")
25 string(REPLACE "a tool for static C/C++ code analysis" "an open source lint-like tool from Google" cur_file_content "${cur_file_content}")
26 string(REPLACE "http://cppcheck.sourceforge.net" "http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py" cur_file_content "${cur_file_content}")
27 string(REPLACE "IRC: <a href=\"irc://irc.freenode.net/cppcheck\">irc://irc.freenode.net/cppcheck</a>" " " cur_file_content "${cur_file_content}")
29 file(WRITE "${REPORT_DIR}/index.html" "${cur_file_content}")