File tree Expand file tree Collapse file tree 1 file changed +26
-17
lines changed
Expand file tree Collapse file tree 1 file changed +26
-17
lines changed Original file line number Diff line number Diff line change 11# Include a system directory (which suppresses its warnings).
2- function (
3- target_include_system_directories
4- target
5- scope
6- lib_include_dirs)
7- if (MSVC )
8- # system includes do not work in MSVC
9- # awaiting https://gitlab.kitware.com/cmake/cmake/-/issues/18272#
10- # awaiting https://gitlab.kitware.com/cmake/cmake/-/issues/17904
11- target_include_directories (${target} ${scope} ${lib_include_dirs} )
12- else ()
13- target_include_directories (
14- ${target}
15- SYSTEM
16- ${scope}
17- ${lib_include_dirs} )
18- endif ()
2+ function (target_include_system_directories target )
3+ set (multiValueArgs INTERFACE PUBLIC PRIVATE )
4+ cmake_parse_arguments (
5+ ARG
6+ ""
7+ ""
8+ "${multiValueArgs} "
9+ ${ARGN} )
10+
11+ foreach (scope IN ITEMS INTERFACE PUBLIC PRIVATE )
12+ foreach (lib_include_dirs IN LISTS ARG_${scope} )
13+ if (MSVC )
14+ # system includes do not work in MSVC
15+ # awaiting https://gitlab.kitware.com/cmake/cmake/-/issues/18272#
16+ # awaiting https://gitlab.kitware.com/cmake/cmake/-/issues/17904
17+ target_include_directories (${target} ${scope} ${lib_include_dirs} )
18+ else ()
19+ target_include_directories (
20+ ${target}
21+ SYSTEM
22+ ${scope}
23+ ${lib_include_dirs} )
24+ endif ()
25+ endforeach ()
26+ endforeach ()
27+
1928endfunction ()
2029
2130# Include the directories of a library target as system directories (which suppresses their warnings).
You can’t perform that action at this time.
0 commit comments