3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-18 12:03:50 +01:00

[cmake] Protect against flags -I/usr/include in extract_flags.cmake

This commit is contained in:
Nils Wentzell 2020-07-08 11:25:57 -04:00
parent 15e4c6d635
commit c04128fa0d

View File

@ -76,10 +76,14 @@ macro(extract_flags)
list(REMOVE_ITEM sys_inc_dirs ${inc_dirs}) list(REMOVE_ITEM sys_inc_dirs ${inc_dirs})
endif() endif()
foreach(dir ${inc_dirs}) foreach(dir ${inc_dirs})
if(NOT dir STREQUAL "/usr/include")
set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}") set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}")
endif()
endforeach() endforeach()
foreach(dir ${sys_inc_dirs}) foreach(dir ${sys_inc_dirs})
if(NOT dir STREQUAL "/usr/include")
set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}") set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}")
endif()
endforeach() endforeach()
get_property_recursive(libs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES) get_property_recursive(libs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)