Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

84.8. cppcheck-2.22.0

Static analyser for C and C++ that looks for undefined behaviour and bugs the compiler does not report

2.22.0-1 · GPL-3.0-or-later · 10.5 SBU · 12.5 MiB, 97 files · 41_system, 380 of 1047 · ports/core/devtools/cppcheck

Homepage: https://cppcheck.sourceforge.io/

Why it is in KDOS. The comment above it in script/phases/41_system/packages.d/devtools.txt:

cppcheck is the analyser KDevelop's Cppcheck plugin runs.

Depends on: cmake, ninja, python3, tinyxml2, boost, libxslt, docbook-xsl, docbook-xml, python3-pygments.

Required by (1): kdevelop.

Sources: cppcheck-2.22.0.tar.gz (4.0 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install cppcheck'

build.sh:

cmake -S . -B build -G Ninja \
	-D CMAKE_BUILD_TYPE=Release \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D FILESDIR=/usr/share/cppcheck \
	-D BUILD_CLI=ON \
	-D BUILD_GUI=OFF \
	-D BUILD_TESTING=OFF \
	-D HAVE_RULES=OFF \
	-D USE_BUNDLED_TINYXML2=OFF \
	-D USE_MATCHCOMPILER=On \
	-D USE_BOOST=On \
	-D NO_UNIX_BACKTRACE_SUPPORT=ON
cmake --build build
DESTDIR=$PKG cmake --install build

xsltproc --nonet --param man.charmap.use.subset 0 \
	/usr/share/xml/docbook/xsl-stylesheets-[0-9]*/manpages/docbook.xsl man/cppcheck.1.xml
install -Dm644 cppcheck.1 "$PKG/usr/share/man/man1/cppcheck.1"
install -Dm755 htmlreport/cppcheck-htmlreport "$PKG/usr/bin/cppcheck-htmlreport"

test -x "$PKG/usr/bin/cppcheck"
test -f "$PKG/usr/share/cppcheck/cfg/std.cfg"

Programs: cppcheck, cppcheck-htmlreport.

Directories: /usr/share/cppcheck, /usr/share/licenses/cppcheck.