Warning, /acts/cmake/ActsTargetLinkLibrariesSystem.cmake is written in an unsupported language. File is not indexed.
0001 # from https://stackoverflow.com/a/52136398
0002 # necessary until cmake 3.25 https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM
0003
0004 function(acts_target_link_libraries_system target)
0005 set(options PRIVATE PUBLIC INTERFACE)
0006 cmake_parse_arguments(TLLS "${options}" "" "" ${ARGN})
0007 foreach(op ${options})
0008 if(TLLS_${op})
0009 set(scope ${op})
0010 endif()
0011 endforeach(op)
0012 set(libs ${TLLS_UNPARSED_ARGUMENTS})
0013
0014 foreach(lib ${libs})
0015 get_target_property(
0016 lib_include_dirs
0017 ${lib}
0018 INTERFACE_INCLUDE_DIRECTORIES
0019 )
0020 if(lib_include_dirs)
0021 if(scope)
0022 target_include_directories(
0023 ${target}
0024 SYSTEM
0025 ${scope}
0026 ${lib_include_dirs}
0027 )
0028 else()
0029 target_include_directories(
0030 ${target}
0031 SYSTEM
0032 PRIVATE ${lib_include_dirs}
0033 )
0034 endif()
0035 else()
0036 message(
0037 "Warning: ${lib} doesn't set INTERFACE_INCLUDE_DIRECTORIES. No include_directories set."
0038 )
0039 endif()
0040 if(scope)
0041 target_link_libraries(${target} ${scope} ${lib})
0042 else()
0043 target_link_libraries(${target} ${lib})
0044 endif()
0045 endforeach()
0046 endfunction(acts_target_link_libraries_system)