CMake: Store the plugin types in the module json files
This will be read by windeployqt. Pick-to: 6.5 Change-Id: I8dfebae755ef61967e924db3c5631af5cc4e2440 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
26b5325767
commit
0b92502de2
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "${target}",
|
"name": "${target}",
|
||||||
"version": "${PROJECT_VERSION}",
|
"repository": "${lower_case_project_name}",
|
||||||
|
"version": "${PROJECT_VERSION}",${extra_module_information}
|
||||||
"built_with": {${extra_build_information}
|
"built_with": {${extra_build_information}
|
||||||
"compiler_id": "${CMAKE_CXX_COMPILER_ID}",
|
"compiler_id": "${CMAKE_CXX_COMPILER_ID}",
|
||||||
"compiler_target": "${CMAKE_CXX_COMPILER_TARGET}",
|
"compiler_target": "${CMAKE_CXX_COMPILER_TARGET}",
|
||||||
|
@ -1032,6 +1032,17 @@ the different base name for the module info variables.")
|
|||||||
"${${result}_install_interface_qpa_include_dir}" PARENT_SCOPE)
|
"${${result}_install_interface_qpa_include_dir}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_internal_list_to_json_array out_var list_var)
|
||||||
|
set(result "")
|
||||||
|
foreach(item IN LISTS ${list_var})
|
||||||
|
if(NOT "${result}" STREQUAL "")
|
||||||
|
string(APPEND result ", ")
|
||||||
|
endif()
|
||||||
|
string(APPEND result "\"${item}\"")
|
||||||
|
endforeach()
|
||||||
|
set("${out_var}" "[${result}]" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# Generate a module description file based on the template in ModuleDescription.json.in
|
# Generate a module description file based on the template in ModuleDescription.json.in
|
||||||
function(qt_describe_module target)
|
function(qt_describe_module target)
|
||||||
set(path_suffix "${INSTALL_DESCRIPTIONSDIR}")
|
set(path_suffix "${INSTALL_DESCRIPTIONSDIR}")
|
||||||
@ -1040,10 +1051,22 @@ function(qt_describe_module target)
|
|||||||
|
|
||||||
set(descfile_in "${QT_CMAKE_DIR}/ModuleDescription.json.in")
|
set(descfile_in "${QT_CMAKE_DIR}/ModuleDescription.json.in")
|
||||||
set(descfile_out "${build_dir}/${target}.json")
|
set(descfile_out "${build_dir}/${target}.json")
|
||||||
|
string(TOLOWER "${PROJECT_NAME}" lower_case_project_name)
|
||||||
set(cross_compilation "false")
|
set(cross_compilation "false")
|
||||||
if(CMAKE_CROSSCOMPILING)
|
if(CMAKE_CROSSCOMPILING)
|
||||||
set(cross_compilation "true")
|
set(cross_compilation "true")
|
||||||
endif()
|
endif()
|
||||||
|
set(extra_module_information "")
|
||||||
|
|
||||||
|
get_target_property(target_type ${target} TYPE)
|
||||||
|
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
|
||||||
|
get_target_property(plugin_types ${target} MODULE_PLUGIN_TYPES)
|
||||||
|
if(plugin_types)
|
||||||
|
qt_internal_list_to_json_array(plugin_types plugin_types)
|
||||||
|
string(APPEND extra_module_information "\n \"plugin_types\": ${plugin_types},")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(extra_build_information "")
|
set(extra_build_information "")
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
string(APPEND extra_build_information "
|
string(APPEND extra_build_information "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user