Back to home page

sPhenix code displayed by LXR

 
 

    


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(lib_include_dirs ${lib} INTERFACE_INCLUDE_DIRECTORIES)
0016     if(lib_include_dirs)
0017       if(scope)
0018         target_include_directories(${target} SYSTEM ${scope} ${lib_include_dirs})
0019       else()
0020         target_include_directories(${target} SYSTEM PRIVATE ${lib_include_dirs})
0021       endif()
0022     else()
0023       message("Warning: ${lib} doesn't set INTERFACE_INCLUDE_DIRECTORIES. No include_directories set.")
0024     endif()
0025     if(scope)
0026       target_link_libraries(${target} ${scope} ${lib})
0027     else()
0028       target_link_libraries(${target} ${lib})
0029     endif()
0030   endforeach()
0031 endfunction(acts_target_link_libraries_system)