Skip to content

Commit 2106b19

Browse files
add cppcheck to the build when available
1 parent c3ed77d commit 2106b19

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

cpputest-for-qpcpp-lib/CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66

77
add_definitions(-DCPPUTEST_FOR_QPCPP_LIB_VERSION=\"${cpputest-for-qpcpp-lib_VERSION}\")
88

9+
find_program(CPPCHECK cppcheck)
10+
if (CPPCHECK)
11+
set(CMAKE_CXX_CPPCHECK
12+
${CPPCHECK}
13+
--enable=warning,performance,portability
14+
--inline-suppr
15+
--quiet
16+
--suppress=missingIncludeSystem
17+
--error-exitcode=1
18+
-DUINTPTR_MAX=0xFFFFFFFF
19+
)
20+
else ()
21+
message(WARNING "Cppcheck not found, install for additional analysis")
22+
endif ()
23+
924
add_library(cpputest-for-qpcpp-lib
1025
src/cpputest_qf_port.cpp
1126
src/cms_cpputest_qf_ctrl.cpp
@@ -19,4 +34,3 @@ add_subdirectory(tests)
1934
target_include_directories(cpputest-for-qpcpp-lib PUBLIC
2035
${CMS_QPCPP_INCLUDE_DIR}
2136
include)
22-

0 commit comments

Comments
 (0)