Skip to content

Commit

Permalink
fix: check if the given lib is a target inside target_include_system_…
Browse files Browse the repository at this point in the history
…library
  • Loading branch information
aminya committed Nov 2, 2021
1 parent ada7c9f commit b2321fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/SystemLink.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ function(
target
scope
lib)
get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES)
if(lib_include_dirs)
target_include_system_directories(${target} ${scope} ${lib_include_dirs})
else()
message(WARNING "${lib} library does not have the INTERFACE_INCLUDE_DIRECTORIES property.")
# check if this is a target
if(TARGET ${lib})
get_target_property(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES)
if(lib_include_dirs)
target_include_system_directories(${target} ${scope} ${lib_include_dirs})
else()
message(WARNING "${lib} library does not have the INTERFACE_INCLUDE_DIRECTORIES property.")
endif()
endif()
endfunction()

Expand Down

0 comments on commit b2321fe

Please sign in to comment.