Remove GENERATE_METATYPES

It doesn't seem like that it is being used anymore, except an instance
in pro2cmake which I replaced by NO_GENERATE_METATYPES.

Pick-to: 6.5
Change-Id: I135cf47e6041e98b354fb684f0079dad30689dea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Amir Masoud Abdol 2023-01-16 16:05:57 +01:00
parent 7e82577680
commit b171abe695
3 changed files with 12 additions and 19 deletions

View File

@ -17,7 +17,6 @@ macro(qt_internal_get_internal_add_module_keywords option_args single_args multi
NO_GENERATE_METATYPES
NO_HEADERSCLEAN_CHECK
GENERATE_CPP_EXPORTS
GENERATE_METATYPES # TODO: Remove once it is not used anymore
GENERATE_PRIVATE_CPP_EXPORTS
)
set(${single_args}
@ -706,23 +705,16 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
endif()
# Generate metatypes
if(${arg_GENERATE_METATYPES})
# No mention of NO_GENERATE_METATYPES. You should not use it.
message(WARNING "GENERATE_METATYPES is on by default for Qt modules. Please remove the manual specification.")
endif()
if (NOT ${arg_NO_GENERATE_METATYPES})
if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(args "")
if(QT_WILL_INSTALL)
set(metatypes_install_dir "${INSTALL_ARCHDATADIR}/metatypes")
list(APPEND args
__QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()
qt6_extract_metatypes(${target} ${args})
elseif(${arg_GENERATE_METATYPES})
message(FATAL_ERROR "Meta types generation does not work on interface libraries")
if (NOT ${arg_NO_GENERATE_METATYPES} AND NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(args "")
if(QT_WILL_INSTALL)
set(metatypes_install_dir "${INSTALL_ARCHDATADIR}/metatypes")
list(APPEND args
__QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()
qt6_extract_metatypes(${target} ${args})
endif()
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(

View File

@ -390,7 +390,8 @@ if(QT_WILL_INSTALL)
list(APPEND core_metatype_args
__QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}")
endif()
# Use qt6_extract_metatypes instead of GENERATE_METATYPES so that we can manually pass the
# Use qt6_extract_metatypes instead so that we can manually pass the
# additional json files.
qt6_extract_metatypes(Core ${core_metatype_args})

View File

@ -3569,8 +3569,8 @@ def write_module(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
scope._has_private_module = True
if "header_module" in scope.get("CONFIG"):
extra.append("HEADER_MODULE")
if "metatypes" in scope.get("CONFIG") or "qmltypes" in scope.get("CONFIG"):
extra.append("GENERATE_METATYPES")
if not("metatypes" in scope.get("CONFIG") or "qmltypes" in scope.get("CONFIG")):
extra.append("NO_GENERATE_METATYPES")
module_config = scope.get("MODULE_CONFIG")
if len(module_config):