How to ignore 3rd-party sources from static analysis

These CMAKE_ variables just initialize target properties when the target is defined. You can do something like:

block (SCOPE_FOR VARIABLES)
  unset(CMAKE_CXX_CPPCHECK)
  add_subdirectory(Catch2)
endblock ()

to clear these initializations for your 3p projects.

1 Like