title: CMAKE_C_CPPCHECK how to ignore a special file or folder
body: <p>I am using cppcheck with cmake. Which works as expected but I would like to exclude some files or folders from the check. I tried some different things with --supress and --supress-list andi -i but I did not get any solution right now.</p>
  <p>lets say i have this folder structure:</p>
  <pre><code>source
  test
     unity
     lib
        mylib.c
     source
     CMakeLists.txt
  </code></pre>
  <p>So how can i exclude unity and mylib.c from the check? This is a snippet from the CMakeLists.txt ...</p>
  <pre><code>find_program(CMAKE_C_CPPCHECK NAMES cppcheck)
  if (CMAKE_C_CPPCHECK)
      message(&quot;-- CppCheck found : ${CMAKE_C_CPPCHECK}&quot;)
      message(&quot;-- current source dir : ${CMAKE_CURRENT_SOURCE_DIR}&quot;)
      message(&quot;-- source dir : ${CMAKE_SOURCE_DIR}&quot;)
      list(
          APPEND CMAKE_C_CPPCHECK 
              &quot;--enable=warning,style,performance,portability,information,missingInclude&quot;
              &quot;--force&quot;    
              &quot;-i${CMAKE_CURRENT_SOURCE_DIR}/unity/&quot;
              &quot;-i${CMAKE_CURRENT_SOURCE_DIR}/lib/mylib.c&quot;
              #&quot;--suppress=*:${CMAKE_CURRENT_SOURCE_DIR}/unity/*&quot; # also tried this for the folder
      )
  endif()
  </code></pre>
  <p>So nothing works right now. What am I doing wrong here.</p>
  <p>thx</p>