aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/QtPropertyBrowser/cmake/CommonCMakeUtils.cmake
blob: 428dde71fdd215aa45228ec650f151bedbde3bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# extract filename components of all items in src_list in dst_list
# example usage: extract_filename_components(ALL_LIBS_BASENAME ALL_LIBS NAME_WE)
macro(extract_filename_components dst_list src_list component)  
  set(list_var "${${src_list}}")
  #message(STATUS "list_var:     ${list_var}")
  #message(STATUS "component:    ${component}")
  foreach(item ${list_var})
    get_filename_component(BASENAME ${item} ${component})
  list( APPEND ${dst_list} ${BASENAME})
  endforeach()
  #message(STATUS "dst_list:     ${${dst_list}}")
endmacro()


# extract target properties of all items in src_list in dst_list
# example usage: extract_target_properties(QT_INCLUDES Qt5::Core INTERFACE_INCLUDE_DIR)
macro(extract_target_properties target_props target_list property)  
  set(list_var "${${target_list}}")
  # message(STATUS "list_var:     ${list_var}")
  #message(STATUS "property:    ${property}")
  foreach(item ${list_var})
    get_target_property(value ${item} ${property})
  list( APPEND ${target_props} ${value})
  endforeach()
  #message(STATUS "target_props:     ${${target_props}}")
  list(REMOVE_DUPLICATES ${target_props})
endmacro()