I have recently discovered the SYSTEM flag for include_directories() (https://cmake.org/cmake/help/v3.0/command/include_directories.html). I’ve added this to my main CMake file for all external libraries that use include_directories so that I can enable -Wall -Wpedantic -Wextra and get warnings about my code, but not worry about external libraries.
However, I can’t see how to do this for ITK, because for ITK I have include( $ITK_USE_FILE ) instead of include_directories. Sadly, ITK does throw up a lot of warnings with -Wpedantic, e.g.:
../External/ITK/Modules/Core/Common/include/itkMath.h:204:40: warning: extra ; [-Wpedantic]
itkTemplateFloatingToIntegerMacro(Ceil);
This is with v4.13.0 checked-out, I haven’t had a chance to move to ITK 5 yet.
Do you do #include "file" or #include < file >, when you #include an ITK header file? It might be that #include < file > works best, for the compiler to recognize the ITK headers as system headers.
Anyway, I hope that someone else can help you any further!
I hadn’t thought about “” versus <>. To be honest I am a bit sloppy about which I use, and I thought that these days there is little difference between them (it doesn’t seem to matter which I use, the compiler finds the right files)
I may be wrong on both points if others wish to enlighten me!