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.

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?

I've created a minimal example here:
http://github.com/jbohren/isystem

Thanks!
-j

[1] https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
> 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.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to