diff options
-rw-r--r-- | cmake/QtAppHelpers.cmake | 2 | ||||
-rw-r--r-- | cmake/QtExecutableHelpers.cmake | 2 | ||||
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 4 | ||||
-rw-r--r-- | src/corelib/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/corelib/Qt6AndroidMacros.cmake | 10 | ||||
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 57 |
6 files changed, 35 insertions, 42 deletions
diff --git a/cmake/QtAppHelpers.cmake b/cmake/QtAppHelpers.cmake index 9958b134aa..e7f96b8c52 100644 --- a/cmake/QtAppHelpers.cmake +++ b/cmake/QtAppHelpers.cmake @@ -93,7 +93,7 @@ function(qt_internal_finalize_app target) qt_internal_update_app_target_info_properties("${target}") if(WIN32) - qt6_generate_win32_rc_file("${target}") + _qt_internal_generate_win32_rc_file("${target}") endif() # Rpaths need to be applied in the finalizer, because the MACOSX_BUNDLE property might be diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake index ad2ce9f30c..27aeaf62b2 100644 --- a/cmake/QtExecutableHelpers.cmake +++ b/cmake/QtExecutableHelpers.cmake @@ -68,7 +68,7 @@ function(qt_internal_add_executable name) endif() if (WIN32 AND NOT arg_DELAY_RC) - qt6_generate_win32_rc_file(${name}) + _qt_internal_generate_win32_rc_file(${name}) endif() qt_set_common_target_properties(${name}) diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 97a25fa38e..5506649439 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -146,7 +146,7 @@ function(qt_internal_add_module target) qt_internal_apply_win_prefix_and_suffix("${target}") if (WIN32 AND BUILD_SHARED_LIBS) - qt6_generate_win32_rc_file(${target}) + _qt_internal_generate_win32_rc_file(${target}) endif() endif() @@ -476,7 +476,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") else() set(args INSTALL_DIR "${metatypes_install_dir}") endif() - qt6_generate_meta_types_json_file(${target} ${args}) + qt6_extract_metatypes(${target} ${args}) endif() configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 061032fad7..e9c934acf4 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -315,7 +315,7 @@ if (NOT QT_WILL_INSTALL) set(core_qobject_metatypes_json_args INSTALL_DIR "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/metatypes") endif() -qt6_generate_meta_types_json_file(Core_qobject +qt6_extract_metatypes(Core_qobject MANUAL_MOC_JSON_FILES ${core_qobject_metatypes_json_list} ${core_qobject_metatypes_json_args} ) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index e3ed88ff24..499fd16c0b 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -1,7 +1,7 @@ # Generate deployment tool json # Locate newest Android sdk build tools revision -function(qt6_android_get_sdk_build_tools_revision out_var) +function(_qt_internal_android_get_sdk_build_tools_revision out_var) if (NOT QT_ANDROID_SDK_BUILD_TOOLS_REVISION) file(GLOB android_build_tools LIST_DIRECTORIES true @@ -17,12 +17,6 @@ function(qt6_android_get_sdk_build_tools_revision out_var) set(${out_var} "${android_build_tools_latest}" PARENT_SCOPE) endfunction() -if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_android_get_sdk_build_tools_revision) - qt6_android_get_sdk_build_tools_revision(${ARGV}) - endfunction() -endif() - # Generate the deployment settings json file for a cmake target. function(qt6_android_generate_deployment_settings target) # Information extracted from mkspecs/features/android/android_deployment_settings.prf @@ -84,7 +78,7 @@ Please recheck your build configuration.") " \"sdk\": \"${android_sdk_root_native}\",\n") # Android SDK Build Tools Revision - qt6_android_get_sdk_build_tools_revision(QT_ANDROID_SDK_BUILD_TOOLS_REVISION) + _qt_internal_android_get_sdk_build_tools_revision(QT_ANDROID_SDK_BUILD_TOOLS_REVISION) string(APPEND file_contents " \"sdkBuildToolsRevision\": \"${QT_ANDROID_SDK_BUILD_TOOLS_REVISION}\",\n") diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index a3fa9d3656..4a60d61eea 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -39,7 +39,7 @@ include(CMakeParseArguments) # macro used to create the names of output files preserving relative dirs -macro(qt6_make_output_file infile prefix ext outfile ) +macro(_qt_internal_make_output_file infile prefix ext outfile ) string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) string(LENGTH ${infile} _infileLength) set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR}) @@ -71,8 +71,7 @@ macro(qt6_make_output_file infile prefix ext outfile ) set(${outfile} ${outpath}/${prefix}${_outfile}.${ext}) endmacro() - -macro(qt6_get_moc_flags _moc_flags) +macro(_qt_internal_get_moc_flags _moc_flags) set(${_moc_flags}) get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) @@ -102,9 +101,8 @@ macro(qt6_get_moc_flags _moc_flags) endif() endmacro() - # helper macro to set up a moc rule -function(qt6_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends) +function(_qt_internal_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends) # Pass the parameters in a file. Set the working directory to # be that containing the parameters file and reference it by # just the file name. This is necessary because the moc tool on @@ -149,10 +147,9 @@ function(qt6_create_moc_command infile outfile moc_flags moc_options moc_target set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON) endfunction() - function(qt6_generate_moc infile outfile ) # get include dirs and flags - qt6_get_moc_flags(moc_flags) + _qt_internal_get_moc_flags(moc_flags) get_filename_component(abs_infile ${infile} ABSOLUTE) set(_outfile "${outfile}") if(NOT IS_ABSOLUTE "${outfile}") @@ -161,7 +158,7 @@ function(qt6_generate_moc infile outfile ) if ("x${ARGV2}" STREQUAL "xTARGET") set(moc_target ${ARGV3}) endif() - qt6_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "") + _qt_internal_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "") endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) @@ -179,7 +176,7 @@ endif() function(qt6_wrap_cpp outfiles ) # get include dirs - qt6_get_moc_flags(moc_flags) + _qt_internal_get_moc_flags(moc_flags) set(options) set(oneValueArgs TARGET) @@ -194,8 +191,9 @@ function(qt6_wrap_cpp outfiles ) foreach(it ${moc_files}) get_filename_component(it ${it} ABSOLUTE) - qt6_make_output_file(${it} moc_ cpp outfile) - qt6_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}") + _qt_internal_make_output_file(${it} moc_ cpp outfile) + _qt_internal_create_moc_command( + ${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}") list(APPEND ${outfiles} ${outfile}) endforeach() set(${outfiles} ${${outfiles}} PARENT_SCOPE) @@ -235,7 +233,7 @@ function(_qt6_parse_qrc_file infile _out_depends _rc_depends) # Since this cmake macro is doing the dependency scanning for these files, # let's make a configured file and add it as a dependency so cmake is run # again when dependencies need to be recomputed. - qt6_make_output_file("${infile}" "" "qrc.depends" out_depends) + _qt_internal_make_output_file("${infile}" "" "qrc.depends" out_depends) configure_file("${infile}" "${out_depends}" COPYONLY) else() # The .qrc file does not exist (yet). Let's add a dependency and hope @@ -424,6 +422,10 @@ endif() set(_Qt6_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") +# This function is currently in Technical Preview. +# It's signature and behavior might change. +# +# Wrapper function that adds an executable with some Qt specific behavior. function(add_qt_gui_executable target) if(ANDROID) add_library("${target}" MODULE ${ARGN}) @@ -445,7 +447,7 @@ function(add_qt_gui_executable target) endif() if (WIN32) - qt6_generate_win32_rc_file(${target}) + _qt_internal_generate_win32_rc_file(${target}) endif() if(ANDROID) @@ -563,9 +565,10 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) endif() -# Generate Qt metatypes.json for a target. By default we check whether AUTOMOC -# has been enabled and we extract the information from that target. Should you -# not wish to use automoc you need to pass in all the generated json files via the +# Extracts metatypes from a Qt target and generates a metatypes.json for it. +# By default we check whether AUTOMOC has been enabled and we extract the information from the +# target's AUTOMOC supporting files. +# Should you not wish to use automoc you need to pass in all the generated json files via the # MANUAL_MOC_JSON_FILES parameter. The latter can be obtained by running moc with # the --output-json parameter. # Params: @@ -574,7 +577,7 @@ endif() # Executable metatypes files are never installed. # COPY_OVER_INSTALL: (Qt Internal) When present will install the file via a post build step # copy rather than using install. -function(qt6_generate_meta_types_json_file target) +function(qt6_extract_metatypes target) get_target_property(existing_meta_types_file ${target} INTERFACE_QT_META_TYPES_BUILD_FILE) if (existing_meta_types_file) @@ -820,8 +823,8 @@ function(qt6_generate_meta_types_json_file target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_meta_types_json_file) - qt6_generate_meta_types_json_file(${ARGV}) + function(qt_extract_metatypes) + qt6_extract_metatypes(${ARGV}) endfunction() endif() @@ -842,7 +845,7 @@ endif() # If you do not wish to auto-generate rc files, it's possible to provide your # own RC file by setting the property QT_TARGET_WINDOWS_RC_FILE with a path to # an existing rc file. -function(qt6_generate_win32_rc_file target) +function(_qt_internal_generate_win32_rc_file target) set(prohibited_target_types INTERFACE_LIBRARY STATIC_LIBRARY OBJECT_LIBRARY) get_target_property(target_type ${target} TYPE) if(target_type IN_LIST prohibited_target_types) @@ -1031,12 +1034,6 @@ END endif() endfunction() -if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_win32_rc_file) - qt6_generate_win32_rc_file(${ARGV}) - endfunction() -endif() - function(__qt_get_relative_resource_path_for_file output_alias file) get_property(alias SOURCE ${file} PROPERTY QT_RESOURCE_ALIAS) if (NOT alias) @@ -1222,6 +1219,8 @@ function(_qt_internal_process_resource target resourceName) endif() endfunction() +# This function is currently in Technical Preview. +# It's signature and behavior might change. function(qt6_add_plugin target) cmake_parse_arguments(arg "STATIC" @@ -1287,13 +1286,13 @@ endif() # By default Qt6 forces usage of utf8 sources for consumers of Qt. # Users can opt out of utf8 sources by calling this function with the target name of their # application or library. -function(qt6_disable_utf8_sources target) +function(qt6_allow_non_utf8_sources target) set_target_properties("${target}" PROPERTIES QT_NO_UTF8_SOURCE TRUE) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_disable_utf8_sources) - qt6_disable_utf8_sources(${ARGV}) + function(qt_allow_non_utf8_sources) + qt6_allow_non_utf8_sources(${ARGV}) endfunction() endif() |