This repository was archived by the owner on Apr 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-24
lines changed
Expand file tree Collapse file tree 1 file changed +6
-24
lines changed Original file line number Diff line number Diff line change 88#=============================================================================#
99function (is_header_discoverable_by_target _header_we _target_name _return_var)
1010
11- # Get target's direct include dirs
12- get_target_property (target_include_dirs ${_target_name} INCLUDE_DIRECTORIES )
11+ get_target_include_directories(${_target_name} target_include_dirs)
1312
14- # Get include dirs of targets linked to the given target
15- get_target_property (target_linked_libs ${_target_name} LINK_LIBRARIES )
13+ get_header_file(${_header_we} ${target_include_dirs} header_found)
1614
17- # Explictly add include dirs of all linked libraries (given they're valid cmake targets)
18- foreach (linked_lib ${target_linked_libs} )
19-
20- if (NOT TARGET ${linked_lib} )
21- continue ()
22- endif ()
23-
24- get_target_property (lib_include_dirs ${linked_lib} INCLUDE_DIRECTORIES )
25- if (NOT "${lib_include_dirs} " MATCHES "NOTFOUND" ) # Library has include dirs
26- list (APPEND include_dirs ${lib_include_dirs} )
27- endif ()
28-
29- endforeach ()
30-
31- if (NOT "${target_include_dirs} " MATCHES "NOTFOUND" ) # Target has direct include dirs
32- list (APPEND include_dirs ${target_include_dirs} )
15+ if (NOT header_found OR "${header_found} " MATCHES "NOTFOUND" )
16+ set (_return_var FALSE PARENT_SCOPE)
17+ else ()
18+ set (_return_var TRUE PARENT_SCOPE)
3319 endif ()
3420
35- _check_header_existance(${_header_we} ${include_dirs} header_found)
36-
37- set (_return_var ${header_found} PARENT_SCOPE)
38-
3921endfunction ()
You can’t perform that action at this time.
0 commit comments