diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-28 01:00:39 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2020-01-28 14:14:20 +0000 |
commit | 558fc903acc610769279da2737ad679aa9fd728d (patch) | |
tree | ebe36deb140e47ca32fea9b0753cde06f465a0fa /src/corelib/Qt5CoreMacros.cmake | |
parent | 089d54f06ff327f5212cb08fdbcb540066357dd5 (diff) | |
parent | be8c257da9a264994243c120231965ff0008ef09 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
src/corelib/io/qsettings.cpp
src/corelib/kernel/qvariant.cpp
src/corelib/serialization/qjsoncbor.cpp
src/corelib/serialization/qjsonvalue.cpp
src/corelib/tools/tools.pri
src/gui/image/qimage.cpp
src/gui/kernel/qguivariant.cpp
src/widgets/kernel/qshortcut.cpp
tests/auto/tools/moc/allmocs_baseline_in.json
tests/auto/tools/moc/tst_moc.cpp
src/opengl/qglframebufferobject.cpp
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Leander Beernaert <leander.beernaert@qt.io>
Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
Diffstat (limited to 'src/corelib/Qt5CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt5CoreMacros.cmake | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index e298cf7de7..6c21470164 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -157,6 +157,16 @@ function(qt5_generate_moc infile outfile ) qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "") endfunction() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + 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() + endfunction() +endif() + # qt5_wrap_cpp(outfiles inputfile ... ) @@ -184,6 +194,17 @@ function(qt5_wrap_cpp outfiles ) set(${outfiles} ${${outfiles}} PARENT_SCOPE) 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) + if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) + qt5_wrap_cpp("${outfiles}" ${ARGN}) + elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) + qt6_wrap_cpp("${outfiles}" ${ARGN}) + endif() + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endfunction() +endif() # _qt5_parse_qrc_file(infile _out_depends _rc_depends) @@ -255,6 +276,16 @@ function(qt5_add_binary_resources target ) add_custom_target(${target} ALL DEPENDS ${rcc_destination}) endfunction() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + 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() + endfunction() +endif() + # qt5_add_resources(outfiles inputfile ... ) @@ -293,6 +324,18 @@ function(qt5_add_resources outfiles ) set(${outfiles} ${${outfiles}} PARENT_SCOPE) endfunction() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + function(qt_add_resources outfiles) + if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) + qt5_add_resources("${outfiles}" ${ARGN}) + elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) + qt6_add_resources("${outfiles}" ${ARGN}) + endif() + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endfunction() +endif() + + # qt5_add_big_resources(outfiles inputfile ... ) function(qt5_add_big_resources outfiles ) @@ -341,6 +384,18 @@ function(qt5_add_big_resources outfiles ) set(${outfiles} ${${outfiles}} PARENT_SCOPE) endfunction() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + function(qt_add_big_resources outfiles) + if(QT_DEFAULT_MAJOR_VERSION EQUAL 5) + qt5_add_big_resources(${outfiles} ${ARGN}) + elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6) + qt6_add_big_resources(${outfiles} ${ARGN}) + endif() + set("${outfiles}" "${${outfiles}}" PARENT_SCOPE) + endfunction() +endif() + + set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") macro(qt5_use_modules _target _link_type) @@ -413,10 +468,19 @@ function(qt5_import_plugins TARGET_NAME) elseif(_doing STREQUAL "EXCLUDE_BY_TYPE") string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}") set_property(TARGET ${TARGET_NAME} PROPERTY "QT_PLUGINS_${_plugin_type}" -) - set(_doing "") else() message(FATAL_ERROR "Unexpected extra argument: \"${_arg}\"") endif() endif() endforeach() endfunction() + +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + 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() + endfunction() +endif() |