This repository has been archived on 2024-08-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
QtPropertyBrowser/cmake/CommonCMakeUtils.cmake
Abhijit Kundu 2b9f84b72b First commit
2014-12-01 13:41:34 -05:00

27 lines
1.1 KiB
CMake

# 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()