diff options
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 9 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 7b901b3c09..77c3128d52 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -426,7 +426,7 @@ set(_Qt6_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") # It's signature and behavior might change. # # Wrapper function that adds an executable with some Qt specific behavior. -function(add_qt_gui_executable target) +function(qt6_add_executable target) if(ANDROID) add_library("${target}" MODULE ${ARGN}) # On our qmake builds we do don't compile the executables with @@ -456,6 +456,13 @@ function(add_qt_gui_executable target) endif() endfunction() +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + function(qt_add_executable) + qt6_add_executable(${ARGV}) + endfunction() +endif() + + function(_qt_get_plugin_name_with_version target out_var) string(REGEX REPLACE "^Qt::(.+)" "Qt${QT_DEFAULT_MAJOR_VERSION}::\\1" qt_plugin_with_version "${target}") diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0e6f916f94..e1a1ed8e11 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3719,7 +3719,7 @@ def write_example( add_target += f"target_sources({binary_name} PRIVATE" else: - add_target = f'add_{"qt_gui_" if gui else ""}executable({binary_name}' + add_target = f'qt_add_executable({binary_name}' write_all_source_file_lists(cm_fh, scope, add_target, indent=0) cm_fh.write(")\n") |