[feature] MSBuildDeps generator: CAExcludePath
See original GitHub issueIn most cases if one wants to run the code analysis included in Visual Studio, one is not interested in findings in external code.
This is possible via the (poorly documented) CAExcludePath property, see e.g. https://stackoverflow.com/questions/43755499/suppress-warnings-for-external-headers-in-vs2017-code-analysis.
It would be nice if the MSBuildDeps generator could populate the CAExcludePath with the include paths of the dependencies.
Depending on how well the visual_studio/visual_studio_multi generators are still maintained, consider adding it there too.
Note that the few examples usages I found on the internet with a quick search seem to have the property under a <PropertyGroup Condition="'$(Language)'=='C++'"> group.
A quick test suggest this is not needed, e.g. if I manually modify conan_boost.props to
...
<PropertyGroup>
<LocalDebuggerEnvironment>PATH=%PATH%;$(ConanboostBinaryDirectories)$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<CAExcludePath>$(ConanboostIncludeDirectories);$(CAExcludePath)</CAExcludePath>
</PropertyGroup>
...
the exclude seems to works fine.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Thanks a lot for adding this this fast.
Did a quick test configuring it using profiles, and seems to works as expected. As we currently do not use the
generatemethod in our recipes, I did not yet test setting theexclude_code_analysisproperty in a recipe instead of the profile.Do I see it correctly that the
[conf]settings can currently not be directly set via an argument then calling e.g.conan install, but instead always have to be in a profile or the global config?Thanks for the feedback @lieser
Based on the discussion, the approach should be:
[conf]behavior can also applied selective to particular packages somypkg:tools.msbuild....is also possible.