<div dir="ltr"><div>I ran into a problem recently where a project I was building set a SYSTEM include directory which was already a non-SYSTEM include directory imported from a dependency. When this happened, CMake dropped the non-SYSTEM directory in favor of the SYSTEM one, causing my build to fail.</div><div><br></div><div>Should this be the correct behavior? According to GCC [1], it gives precedence to non-SYSTEM include directories, and specifying both for the same path produces a warning. With CMake, if both are specified, it ignores the non-SYSTEM include and fails silently. Should CMake be dropping one of the options at all?</div><div><br></div><div>I've created a minimal example here: </div><div><a href="http://github.com/jbohren/isystem">http://github.com/jbohren/isystem</a></div><div><br></div><div>Thanks!</div><div>-j</div><div><br></div><div>[1] <a href="https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html">https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html</a></div><div>> All directories named by -isystem are searched after all directories named by -I, no matter what their order was on the command line. If the same directory is named by both -I and -isystem, the -I option is ignored. GCC provides an informative message when this occurs if -v is used.</div><div><br></div></div>