File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -60,3 +60,4 @@ include(tools/ClangFormat)
6060
6161# === Linting ===
6262include (tools/ClangTidy)
63+ include (tools/Cppcheck)
Original file line number Diff line number Diff line change 1+ find_program (CPPCHECK_EXE NAMES cppcheck)
2+
3+ if (CPPCHECK_EXE)
4+ file (GLOB_RECURSE CPPCHECK_SOURCE_FILES
5+ "${CMAKE_SOURCE_DIR} /src/*.cpp"
6+ "${CMAKE_SOURCE_DIR} /src/**/*.cpp"
7+ "${CMAKE_SOURCE_DIR} /include/**/*.hpp"
8+ )
9+
10+ add_custom_target (cppcheck
11+ COMMAND ${CPPCHECK_EXE}
12+ --enable=all
13+ --inconclusive
14+ --quiet
15+ ${CPPCHECK_SOURCE_FILES}
16+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
17+ COMMENT "Running cppcheck analysis"
18+ VERBATIM
19+ )
20+ else ()
21+ message (STATUS "⚠️ cppcheck not found — 'cppcheck' target will not be available." )
22+ endif ()
You can’t perform that action at this time.
0 commit comments