Feature Request: Add in SYSTEM option for INTERFACE_INCLUDE_DIRECTORIES just like target_include_directories
I am on Ubuntu 16.04, latest CMake. Say my downstream project has really strict compilation flags, and it treat warnings as errors. When I link to external libraries and include their headers, since they don't code in such strict compilation flags, their headers will having warnings which turns into an error and causing my downstream project to stop compiling.
If the external libraries is used in old cmake fashion, which means the argument of target_link_libraries
is the library itself instead of a cmake target, I can silence the warning with the SYSTEM
keyword in target_include_directories
find_package( OpenCV REQUIRED )
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
However, if the external libraries is used in modern cmake fashion, which means the argument of target_link_libraries
is a cmake target, and it's including headers based on INTERFACE_INCLUDE_DIRECTORIES
based on what's inside XXXConfig.cmake, there isn't a way for me to pass in the SYSTEM
flag anywhere to silence the warning.
find_package( glog REQUIRED )
target_link_libraries(${PROJECT_NAME} glog::glog)
Could we add a feature so we can apply the SYSTEM
flag somewhere to the includes from INTERFACE_INCLUDE_DIRECTORIES
?