Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2023-05-18 20:34:12 +08:00
parent f502170cbe
commit 4929d8f0d3
1 changed files with 20 additions and 0 deletions

View File

@ -1380,3 +1380,23 @@ function(query_qt_library_info)
set(${QT_ARGS_VERSION} "${QT_VERSION}" PARENT_SCOPE)
endif()
endfunction()
function(dump_target_info)
cmake_parse_arguments(arg "" "" "TARGETS" ${ARGN})
if(NOT arg_TARGETS)
message(AUTHOR_WARNING "dump_target_info: you have to specify at least one target!")
return()
endif()
foreach(__target ${arg_TARGETS})
if(NOT TARGET ${__target})
message(AUTHOR_WARNING "${__target} is not a valid CMake target!")
continue()
endif()
get_target_property(__compile_options ${__target} COMPILE_OPTIONS)
get_target_property(__compile_definitions ${__target} COMPILE_DEFINITIONS)
get_target_property(__link_options ${__target} LINK_OPTIONS)
message("${__target}'s compile options: ${__compile_options}")
message("${__target}'s compile definitions: ${__compile_definitions}")
message("${__target}'s link options: ${__link_options}")
endforeach()
endfunction()