diff options
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index cff947d808..80d2d4cf4d 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) - macro(qt_generate_moc) + function(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() - endmacro() + endfunction() endif() @@ -203,13 +203,14 @@ endfunction() # This will override the CMake upstream command, because that one is for Qt 3. if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_wrap_cpp) + function(qt_wrap_cpp outfiles) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_wrap_cpp(${ARGV}) + qt5_wrap_cpp("${outfiles}" ${ARGN}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_wrap_cpp(${ARGV}) + qt6_wrap_cpp("${outfiles}" ${ARGN}) endif() - endmacro() + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endfunction() endif() @@ -290,13 +291,13 @@ function(qt6_add_binary_resources target ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_binary_resources) + function(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() - endmacro() + endfunction() endif() @@ -348,13 +349,16 @@ function(qt6_add_resources outfiles ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_resources) + function(qt_add_resources outfiles) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_resources(${ARGV}) + qt5_add_resources("${outfiles}" ${ARGN}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_resources(${ARGV}) + qt6_add_resources("${outfiles}" ${ARGN}) endif() - endmacro() + if(NOT TARGET ${outfiles}) + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endif() + endfunction() endif() @@ -423,13 +427,14 @@ function(qt6_add_big_resources outfiles ) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_big_resources) + function(qt_add_big_resources outfiles) if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) - qt5_add_big_resources(${ARGV}) + qt5_add_big_resources(${outfiles} ${ARGN}) elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) - qt6_add_big_resources(${ARGV}) + qt6_add_big_resources(${outfiles} ${ARGN}) endif() - endmacro() + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endfunction() endif() function(_qt_internal_apply_win_prefix_and_suffix target) @@ -773,17 +778,17 @@ function(_qt_internal_finalize_ios_app target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_executable) + function(qt_add_executable) qt6_add_executable(${ARGV}) - endmacro() - macro(qt_finalize_target) + endfunction() + function(qt_finalize_target) qt6_finalize_target(${ARGV}) - endmacro() + endfunction() # Kept for compatibility with Qt Creator 4.15 wizards - macro(qt_finalize_executable) + function(qt_finalize_executable) qt6_finalize_target(${ARGV}) - endmacro() + endfunction() endif() function(_qt_get_plugin_name_with_version target out_var) @@ -893,13 +898,13 @@ function(qt6_import_plugins target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_import_plugins) + function(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() - endmacro() + endfunction() endif() # This function is currently in Technical Preview. It's signature may change or be removed entirely. @@ -946,9 +951,9 @@ function(qt6_set_finalizer_mode target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_set_finalizer_mode) + function(qt_set_finalizer_mode) qt6_set_finalizer_mode(${ARGV}) - endmacro() + endfunction() endif() # Extracts metatypes from a Qt target and generates a metatypes.json for it. @@ -1227,9 +1232,9 @@ function(qt6_extract_metatypes target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_extract_metatypes) + function(qt_extract_metatypes) qt6_extract_metatypes(${ARGV}) - endmacro() + endfunction() endif() # Generate Win32 RC files for a target. All entries in the RC file are generated @@ -1975,9 +1980,9 @@ function(qt6_add_plugin target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_plugin) + function(qt_add_plugin) qt6_add_plugin(${ARGV}) - endmacro() + endfunction() endif() # Creates a library by forwarding arguments to add_library, applies some Qt naming file name naming @@ -2077,9 +2082,9 @@ function(_qt_internal_add_library target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_add_library) + function(qt_add_library) qt6_add_library(${ARGV}) - endmacro() + endfunction() endif() # By default Qt6 forces usage of utf8 sources for consumers of Qt. @@ -2090,9 +2095,9 @@ function(qt6_allow_non_utf8_sources target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_allow_non_utf8_sources) + function(qt_allow_non_utf8_sources) qt6_allow_non_utf8_sources(${ARGV}) - endmacro() + endfunction() endif() function(_qt_internal_apply_strict_cpp target) @@ -2190,7 +2195,7 @@ function(qt6_disable_unicode_defines target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - macro(qt_disable_unicode_defines) + function(qt_disable_unicode_defines) qt6_disable_unicode_defines(${ARGV}) - endmacro() + endfunction() endif() |