In Ubuntu I am trying to integrate Cppcheck with CMake through a CMakeLists.txt
file:
add_custom_target(
cppcheck
COMMAND /usr/bin/cppcheck *.cpp --xml 2>cppcheck_result.xml
--enable=warning,performance,portability,information,missingInclude
--std=c++11
--library=qt.cfg
--template="[{severity}][{id}] {message} {callstack} \(On {file}:{line}\)"
--verbose
--quiet
${ALL_SOURCE_FILES}
)
add_executable(test hello.cpp)
I added the commands above in the CMakeLists.txt
file, but it doesn't work.