c++ - Cmake: check if system include directory -


is possible cmake 2.6 (or higher, if not possible in version) check whether include directory marked system (e.g. compile isystem gcc flag, see 2.8 system headers)?

for example, include directories of current target with:

get_property(_target_include_dirs directory ${cmake_current_source_dir} property include_directories) 

how know ones marked isystem?

thanks

looking @ cmake source, whether include directory added include_directories marked system seems tracked in cmake internals, , not available consumption inside cmakelists.txt¹.

however, target property interface_include_directories (populated target_include_directories either public or interface), there target property named interface_system_include_directories:

add_library(testlib test.cc)  target_include_directories(testlib system interface /target_system)  get_property(_system_include_dirs target testlib property interface_system_include_directories) message("system: ${_system_include_dirs}") 

so maybe can use instead.

¹ there mention of system_include_directories property available through generator expression, couldn't work.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -