Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / cmake / cpplint_html.cmake
1 # Copyright (C) 2018-2019 Intel Corporation
2 #
3 # SPDX-License-Identifier: Apache-2.0
4 #
5
6 if(EXISTS "${REPORT_DIR}")
7     file(REMOVE_RECURSE "${REPORT_DIR}")
8 endif()
9
10 file(MAKE_DIRECTORY "${REPORT_DIR}")
11
12 execute_process(
13     COMMAND
14         "${PYTHON_EXECUTABLE}"
15         "${CONVERT_SCRIPT}"
16         "--file=${INPUT_FILE}"
17         "--report-dir=${REPORT_DIR}"
18         "--source-dir=${SOURCE_DIR}"
19         "--title=${TITLE}")
20
21 # Change cppcheck things to cpplint
22
23 file(READ "${REPORT_DIR}/index.html" cur_file_content)
24
25 string(REPLACE "Cppcheck" "cpplint" cur_file_content ${cur_file_content})
26 string(REPLACE "a tool for static C/C++ code analysis" "an open source lint-like tool from Google" cur_file_content ${cur_file_content})
27 string(REPLACE "http://cppcheck.sourceforge.net" "http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py" cur_file_content ${cur_file_content})
28 string(REPLACE "IRC: <a href=\"irc://irc.freenode.net/cppcheck\">irc://irc.freenode.net/cppcheck</a>" " " cur_file_content ${cur_file_content})
29
30 file(WRITE "${REPORT_DIR}/index.html" "${cur_file_content}")