diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index c5f04c49bc..9b68d57001 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -262,9 +262,9 @@ function(qt6_android_generate_deployment_settings target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_android_generate_deployment_settings) + macro(qt_android_generate_deployment_settings) qt6_android_generate_deployment_settings(${ARGV}) - endfunction() + endmacro() endif() function(qt6_android_apply_arch_suffix target) @@ -277,9 +277,9 @@ function(qt6_android_apply_arch_suffix target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_android_apply_arch_suffix) + macro(qt_android_apply_arch_suffix) qt6_android_apply_arch_suffix(${ARGV}) - endfunction() + endmacro() endif() # Add custom target to package the APK @@ -397,7 +397,7 @@ function(_qt_internal_create_global_apk_all_target_if_needed) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_android_add_apk_target) + macro(qt_android_add_apk_target) qt6_android_add_apk_target(${ARGV}) - endfunction() + endmacro() endif() diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index e1fa29b371..567d5f2475 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -164,13 +164,13 @@ function(qt6_generate_moc infile outfile ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_moc) + macro(qt_generate_moc) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) qt5_generate_moc(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) qt6_generate_moc(${ARGV}) endif() - endfunction() + endmacro() endif() @@ -203,14 +203,13 @@ endfunction() # This will override the CMake upstream command, because that one is for Qt 3. if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_wrap_cpp outfiles) + macro(qt_wrap_cpp) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_wrap_cpp("${outfiles}" ${ARGN}) + qt5_wrap_cpp(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_wrap_cpp("${outfiles}" ${ARGN}) + qt6_wrap_cpp(${ARGV}) endif() - set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) - endfunction() + endmacro() endif() @@ -291,13 +290,13 @@ function(qt6_add_binary_resources target ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_binary_resources) + macro(qt_add_binary_resources) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) qt5_add_binary_resources(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) qt6_add_binary_resources(${ARGV}) endif() - endfunction() + endmacro() endif() @@ -349,16 +348,13 @@ function(qt6_add_resources outfiles ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_resources outfiles) + macro(qt_add_resources) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_resources("${outfiles}" ${ARGN}) + qt5_add_resources(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_resources("${outfiles}" ${ARGN}) + qt6_add_resources(${ARGV}) endif() - if(NOT TARGET ${outfiles}) - set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) - endif() - endfunction() + endmacro() endif() @@ -427,14 +423,13 @@ function(qt6_add_big_resources outfiles ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_big_resources outfiles) + macro(qt_add_big_resources) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_big_resources(${outfiles} ${ARGN}) + qt5_add_big_resources(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_big_resources(${outfiles} ${ARGN}) + qt6_add_big_resources(${ARGV}) endif() - set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) - endfunction() + endmacro() endif() function(_qt_internal_apply_win_prefix_and_suffix target) @@ -778,17 +773,17 @@ function(_qt_internal_finalize_ios_app target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_executable) + macro(qt_add_executable) qt6_add_executable(${ARGV}) - endfunction() - function(qt_finalize_target) + endmacro() + macro(qt_finalize_target) qt6_finalize_target(${ARGV}) - endfunction() + endmacro() # Kept for compatibility with Qt Creator 4.15 wizards - function(qt_finalize_executable) + macro(qt_finalize_executable) qt6_finalize_target(${ARGV}) - endfunction() + endmacro() endif() function(_qt_get_plugin_name_with_version target out_var) @@ -898,13 +893,13 @@ function(qt6_import_plugins target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_import_plugins) + macro(qt_import_plugins) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) qt5_import_plugins(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) qt6_import_plugins(${ARGV}) endif() - endfunction() + endmacro() endif() # This function is currently in Technical Preview. It's signature may change or be removed entirely. @@ -951,9 +946,9 @@ function(qt6_set_finalizer_mode target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_set_finalizer_mode) + macro(qt_set_finalizer_mode) qt6_set_finalizer_mode(${ARGV}) - endfunction() + endmacro() endif() # Extracts metatypes from a Qt target and generates a metatypes.json for it. @@ -1232,9 +1227,9 @@ function(qt6_extract_metatypes target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_extract_metatypes) + macro(qt_extract_metatypes) qt6_extract_metatypes(${ARGV}) - endfunction() + endmacro() endif() # Generate Win32 RC files for a target. All entries in the RC file are generated @@ -1982,9 +1977,9 @@ function(qt6_add_plugin target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_plugin) + macro(qt_add_plugin) qt6_add_plugin(${ARGV}) - endfunction() + endmacro() endif() # Creates a library by forwarding arguments to add_library, applies some Qt naming file name naming @@ -2084,9 +2079,9 @@ function(_qt_internal_add_library target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_library) + macro(qt_add_library) qt6_add_library(${ARGV}) - endfunction() + endmacro() endif() # By default Qt6 forces usage of utf8 sources for consumers of Qt. @@ -2097,9 +2092,9 @@ function(qt6_allow_non_utf8_sources target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_allow_non_utf8_sources) + macro(qt_allow_non_utf8_sources) qt6_allow_non_utf8_sources(${ARGV}) - endfunction() + endmacro() endif() function(_qt_internal_apply_strict_cpp target) @@ -2197,7 +2192,7 @@ function(qt6_disable_unicode_defines target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_disable_unicode_defines) + macro(qt_disable_unicode_defines) qt6_disable_unicode_defines(${ARGV}) - endfunction() + endmacro() endif() diff --git a/src/dbus/Qt6DBusMacros.cmake b/src/dbus/Qt6DBusMacros.cmake index e4e8635dff..4f5373437a 100644 --- a/src/dbus/Qt6DBusMacros.cmake +++ b/src/dbus/Qt6DBusMacros.cmake @@ -76,14 +76,13 @@ function(qt6_add_dbus_interface _sources _interface _basename) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_dbus_interface sources) + macro(qt_add_dbus_interface) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_dbus_interface("${sources}" ${ARGN}) + qt5_add_dbus_interface(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_dbus_interface("${sources}" ${ARGN}) + qt6_add_dbus_interface(${ARGV}) endif() - set("${sources}" "${${sources}}" PARENT_SCOPE) - endfunction() + endmacro() endif() @@ -100,14 +99,13 @@ function(qt6_add_dbus_interfaces _sources) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_dbus_interfaces sources) + macro(qt_add_dbus_interfaces) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_dbus_interfaces("${sources}" ${ARGN}) + qt5_add_dbus_interfaces(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_dbus_interfaces("${sources}" ${ARGN}) + qt6_add_dbus_interfaces(${ARGV}) endif() - set("${sources}" "${${sources}}" PARENT_SCOPE) - endfunction() + endmacro() endif() @@ -145,13 +143,13 @@ function(qt6_generate_dbus_interface _header) # _customName OPTIONS -some -optio endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_dbus_interface) + macro(qt_generate_dbus_interface) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) qt5_generate_dbus_interface(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) qt6_generate_dbus_interface(${ARGV}) endif() - endfunction() + endmacro() endif() @@ -203,12 +201,11 @@ function(qt6_add_dbus_adaptor _sources _xml_file _include) # _optionalParentClas endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_add_dbus_adaptor sources) + macro(qt_add_dbus_adaptor) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_dbus_adaptor("${sources}" ${ARGN}) + qt5_add_dbus_adaptor(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_dbus_adaptor("${sources}" ${ARGN}) + qt6_add_dbus_adaptor(${ARGV}) endif() - set("${sources}" "${${sources}}" PARENT_SCOPE) - endfunction() + endmacro() endif() diff --git a/src/widgets/Qt6WidgetsMacros.cmake b/src/widgets/Qt6WidgetsMacros.cmake index aa8133ba47..615e3ee695 100644 --- a/src/widgets/Qt6WidgetsMacros.cmake +++ b/src/widgets/Qt6WidgetsMacros.cmake @@ -70,12 +70,11 @@ endfunction() # This will override the CMake upstream command, because that one is for Qt 3. if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_wrap_ui outfiles) + macro(qt_wrap_ui) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_wrap_ui("${outfiles}" ${ARGN}) + qt5_wrap_ui(${ARGV}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_wrap_ui("${outfiles}" ${ARGN}) + qt6_wrap_ui(${ARGV}) endif() - set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) - endfunction() + endmacro() endif()