Based on this answer, I've added the below code to my .vcxproj
file, which nicely eliminates most warnings that I was getting from Qt include files, and its autogenerated moc files.
<PropertyGroup Condition="'$(Language)'=='C++'">
<CAExcludePath>C:\Qt\5.13.1\msvc2017_64\include;.\ProjectName_autogen;$(CAExcludePath)</CAExcludePath>
</PropertyGroup>
This is great for one specific project, but since I use CMake, on multiple computers, this would get overwritten each time the CMake file changes, and I would have to add it to each Project I need it for (there's 3 projects that use Qt). Of course, the issue is also if I change the Qt path, then I would need to update the project files as well.
I am wondering, is there a CMake property I can set in order to add this to the projects? I know how to get Qt's include directory, just looking for the CMake property to actually set the CAExcludePath
. If it helps, I'm using VS 2019, and this is to disable the warnings from Code Analysis.
I did check the cmake-properties page, but didn't find any predefined properties which seem to fit.