0

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rishitha
  • 1
  • 2
  • 1
    Welcome to Stack Overflow. I think the linked question would help to solve your problem. You may need to update your CMake version, but CMake does come with integrated `cppcheck` support. If this - or any other of the available tutorials and answers - does not help you, please describe - in your question - why they don't fit your needs with a concrete description of what you have already tried and the error messages you got. – Florian May 11 '18 at 07:38
  • I am using CMAKE version 2.8.12 and CPPCHECK vesion 1.61 – Rishitha May 11 '18 at 08:43
  • I am trying to invoke cppcheck through CMakeLists.txt file. – Rishitha May 11 '18 at 08:45

0 Answers0