6.6.1 original

This commit is contained in:
kleuter
2023-12-04 18:42:35 +01:00
parent 9bf343ceed
commit 8490fae44c
607 changed files with 15608 additions and 14647 deletions

View File

@ -43,7 +43,8 @@ else()
else()
set(MimerSQL_library_hints "")
endif()
elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"
AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64|)$")
set(MimerSQL_library_hints "/usr/local/lib")
set(MimerSQL_include_dir_hints "/usr/local/include")
else()

View File

@ -276,7 +276,7 @@ function(qt_auto_detect_cmake_config)
endfunction()
function(qt_auto_detect_cyclic_toolchain)
if(CMAKE_TOOLCHAIN_FILE AND CMAKE_TOOLCHAIN_FILE MATCHES "/qt.toolchain.cmake$")
if(CMAKE_TOOLCHAIN_FILE AND CMAKE_TOOLCHAIN_FILE MATCHES "/qt\\.toolchain\\.cmake$")
message(FATAL_ERROR
"Woah there! You can't use the Qt generated qt.toolchain.cmake file to configure "
"qtbase, because that will create a toolchain file that includes itself!\n"

View File

@ -18,10 +18,6 @@ macro(qt_internal_top_level_setup_autodetect)
endmacro()
macro(qt_internal_top_level_setup_after_project)
# TODO: Remove this variable once the top-level calls this function and
# qt_internal_qt_configure_end is not called in qt_print_build_instructions anymore.
set(__qt6_top_level_after_project_called TRUE)
qt_internal_top_level_setup_testing()
endmacro()

View File

@ -111,13 +111,6 @@ from the build directory")
if(QT_SUPERBUILD)
qt_internal_save_previously_visited_packages()
endif()
# TODO: Abuse qt_print_build_instructions being called as the last command in a top-level build.
# Instead we should call this explicitly at the end of the top-level project.
# TODO: Remove this once the top-level calls qt_internal_top_level_setup_after_project
if(QT_SUPERBUILD AND NOT __qt6_top_level_after_project_called)
qt_internal_qt_configure_end()
endif()
endfunction()
function(qt_configure_print_summary_helper summary_reports force_show)

View File

@ -39,6 +39,9 @@ function(qt_internal_read_repo_dependencies out_var repo_dir)
if(NOT dependency IN_LIST seen)
qt_internal_read_repo_dependencies(subdeps "${dependency_repo_dir}"
${seen} ${dependency})
if(dependency MATCHES "^tqtc-(.+)")
set(dependency "${CMAKE_MATCH_1}")
endif()
list(APPEND dependencies ${subdeps} ${dependency})
endif()
endif()
@ -106,6 +109,8 @@ endif()
include(QtPlatformSupport)
# Set FEATURE_${feature} if INPUT_${feature} is set in certain circumstances.
# Set FEATURE_${feature}_computed_from_input to TRUE or FALSE depending on whether the
# INPUT_${feature} value has overridden the FEATURE_${feature} variable.
#
# Needs to be in QtBuildInternalsConfig.cmake instead of QtFeature.cmake because it's used in
# qt_build_internals_disable_pkg_config_if_needed.
@ -126,6 +131,9 @@ function(qt_internal_compute_feature_value_from_possible_input feature)
endif()
set(FEATURE_${feature} "${FEATURE_${feature}}" PARENT_SCOPE)
set(FEATURE_${feature}_computed_from_input TRUE PARENT_SCOPE)
else()
set(FEATURE_${feature}_computed_from_input FALSE PARENT_SCOPE)
endif()
endfunction()
@ -622,9 +630,6 @@ function(qt_internal_qt_configure_end)
# reconfigurations that are done by calling cmake directly don't trigger configure specific
# logic.
unset(QT_INTERNAL_CALLED_FROM_CONFIGURE CACHE)
# Clean up stale feature input values.
qt_internal_clean_feature_inputs()
endfunction()
macro(qt_build_repo)

View File

@ -2,6 +2,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Includes QtSetup and friends for private CMake API.
set(QT_INTERNAL_IS_STANDALONE_TEST TRUE)
qt_internal_project_setup()
qt_build_internals_set_up_private_api()

View File

@ -422,7 +422,8 @@ function(qt_internal_add_configure_time_executable target)
)
set(should_build_at_configure_time TRUE)
if(EXISTS "${target_binary_path}" AND EXISTS "${timestamp_file}")
if(QT_INTERNAL_HAVE_CONFIGURE_TIME_${target} AND
EXISTS "${target_binary_path}" AND EXISTS "${timestamp_file}")
set(last_ts 0)
foreach(source IN LISTS sources)
file(TIMESTAMP "${source}" ts "%s")
@ -437,6 +438,37 @@ function(qt_internal_add_configure_time_executable target)
endif()
endif()
set(cmake_flags_arg "")
if(arg_CMAKE_FLAGS)
set(cmake_flags_arg CMAKE_FLAGS "${arg_CMAKE_FLAGS}")
endif()
qt_internal_get_enabled_languages_for_flag_manipulation(enabled_languages)
foreach(lang IN LISTS enabled_languages)
set(compiler_flags_var "CMAKE_${lang}_FLAGS")
list(APPEND cmake_flags_arg "-D${compiler_flags_var}:STRING=${${compiler_flags_var}}")
if(arg_CONFIG)
set(compiler_flags_var_config "${compiler_flags_var}${config_suffix}")
list(APPEND cmake_flags_arg
"-D${compiler_flags_var_config}:STRING=${${compiler_flags_var_config}}")
endif()
endforeach()
qt_internal_get_target_link_types_for_flag_manipulation(target_link_types)
foreach(linker_type IN LISTS target_link_types)
set(linker_flags_var "CMAKE_${linker_type}_LINKER_FLAGS")
list(APPEND cmake_flags_arg "-D${linker_flags_var}:STRING=${${linker_flags_var}}")
if(arg_CONFIG)
set(linker_flags_var_config "${linker_flags_var}${config_suffix}")
list(APPEND cmake_flags_arg
"-D${linker_flags_var_config}:STRING=${${linker_flags_var_config}}")
endif()
endforeach()
if(NOT "${QT_INTERNAL_CMAKE_FLAGS_CONFIGURE_TIME_TOOL_${target}}" STREQUAL "${cmake_flags_arg}")
set(should_build_at_configure_time TRUE)
endif()
if(should_build_at_configure_time)
foreach(arg IN LISTS multi_value_args)
string(TOLOWER "${arg}" template_arg_name)
@ -460,33 +492,11 @@ function(qt_internal_add_configure_time_executable target)
set(template "${arg_CMAKELISTS_TEMPLATE}")
endif()
set(cmake_flags_arg)
if(arg_CMAKE_FLAGS)
set(cmake_flags_arg CMAKE_FLAGS "${arg_CMAKE_FLAGS}")
endif()
configure_file("${template}" "${target_binary_dir}/CMakeLists.txt" @ONLY)
qt_internal_get_enabled_languages_for_flag_manipulation(enabled_languages)
foreach(lang IN LISTS enabled_languages)
set(compiler_flags_var "CMAKE_${lang}_FLAGS")
list(APPEND cmake_flags_arg "-D${compiler_flags_var}:STRING=${${compiler_flags_var}}")
if(arg_CONFIG)
set(compiler_flags_var_config "${compiler_flags_var}${config_suffix}")
list(APPEND cmake_flags_arg
"-D${compiler_flags_var_config}:STRING=${${compiler_flags_var_config}}")
endif()
endforeach()
qt_internal_get_target_link_types_for_flag_manipulation(target_link_types)
foreach(linker_type IN LISTS target_link_types)
set(linker_flags_var "CMAKE_${linker_type}_LINKER_FLAGS")
list(APPEND cmake_flags_arg "-D${linker_flags_var}:STRING=${${linker_flags_var}}")
if(arg_CONFIG)
set(linker_flags_var_config "${linker_flags_var}${config_suffix}")
list(APPEND cmake_flags_arg
"-D${linker_flags_var_config}:STRING=${${linker_flags_var_config}}")
endif()
endforeach()
if(EXISTS "${target_binary_dir}/CMakeCache.txt")
file(REMOVE "${target_binary_dir}/CMakeCache.txt")
endif()
try_compile(result
"${target_binary_dir}"
@ -496,7 +506,12 @@ function(qt_internal_add_configure_time_executable target)
OUTPUT_VARIABLE try_compile_output
)
set(QT_INTERNAL_CMAKE_FLAGS_CONFIGURE_TIME_TOOL_${target}
"${cmake_flags_arg}" CACHE INTERNAL "")
file(WRITE "${timestamp_file}" "")
set(QT_INTERNAL_HAVE_CONFIGURE_TIME_${target} ${result} CACHE INTERNAL
"Indicates that the configure-time target ${target} was built")
if(NOT result)
message(FATAL_ERROR "Unable to build ${target}: ${try_compile_output}")
endif()

View File

@ -883,6 +883,18 @@ function(qt_internal_detect_dirty_features)
"to ${FEATURE_${feature}}")
set(dirty_build TRUE)
set_property(GLOBAL APPEND PROPERTY _qt_dirty_features "${feature}")
# If the user changed the value of the feature directly (e.g by editing
# CMakeCache.txt), and not via its associated INPUT variable, unset the INPUT cache
# variable before it is used in feature evaluation, to ensure a stale value doesn't
# influence other feature values, especially when QT_INTERNAL_CALLED_FROM_CONFIGURE
# is TRUE and the INPUT_foo variable is not passed.
# e.g. first configure -no-gui, then manually toggle FEATURE_gui to ON in
# CMakeCache.txt, then reconfigure (with the configure script) without -no-gui.
# Without this unset(), we'd have switched FEATURE_gui to OFF again.
if(NOT FEATURE_${feature}_computed_from_input)
unset("INPUT_${feature}" CACHE)
endif()
endif()
unset("QT_FEATURE_${feature}" CACHE)
endforeach()
@ -899,18 +911,6 @@ function(qt_internal_detect_dirty_features)
endif()
endfunction()
function(qt_internal_clean_feature_inputs)
foreach(feature IN LISTS QT_KNOWN_FEATURES)
# Unset the INPUT_foo cache variables after they were used in feature evaluation, to
# ensure stale values don't influence features upon reconfiguration when
# QT_INTERNAL_CALLED_FROM_CONFIGURE is TRUE and the INPUT_foo variable is not passed.
# e.g. first configure -no-gui, then manually toggle FEATURE_gui to ON in
# CMakeCache.txt, then reconfigure (with the configure script) without -no-gui.
# Without this unset(), we'd have switched FEATURE_gui to OFF again.
unset(INPUT_${feature} CACHE)
endforeach()
endfunction()
function(qt_config_compile_test name)
if(DEFINED "TEST_${name}")
return()

View File

@ -1,6 +1,23 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Sets '${var}' to a genex that extracts the target's property.
# Sets 'have_${var}' to a genex that checks that the property has a
# non-empty value.
macro(qt_internal_genex_get_property var target property)
set(${var} "$<TARGET_PROPERTY:${target},${property}>")
set(have_${var} "$<BOOL:${${var}}>")
endmacro()
# Sets '${var}' to a genex that will join the given property values
# using '${glue}' and will surround the entire output with '${prefix}'
# and '${suffix}'.
macro(qt_internal_genex_get_joined_property var target property prefix suffix glue)
qt_internal_genex_get_property("${var}" "${target}" "${property}")
set(${var}
"$<${have_${var}}:${prefix}$<JOIN:${${var}},${glue}>${suffix}>")
endmacro()
# This function generates LD version script for the target and uses it in the target linker line.
# Function has two modes dependending on the specified arguments.
# Arguments:
@ -33,9 +50,21 @@ function(qt_internal_add_linker_version_script target)
endif()
string(APPEND contents "};\n")
set(current "Qt_${PROJECT_VERSION_MAJOR}")
string(APPEND contents "${current} { *; };\n")
string(APPEND contents "${current} {\n *;")
get_target_property(target_type ${target} TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(genex_prefix "\n ")
set(genex_glue "$<SEMICOLON>\n ")
set(genex_suffix "$<SEMICOLON>")
qt_internal_genex_get_joined_property(
linker_exports "${target}" _qt_extra_linker_script_exports
"${genex_prefix}" "${genex_suffix}" "${genex_glue}"
)
string(APPEND contents "${linker_exports}")
endif()
string(APPEND contents "\n};\n")
get_target_property(type ${target} TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(property_genex "$<TARGET_PROPERTY:${target},_qt_extra_linker_script_content>")
set(check_genex "$<BOOL:${property_genex}>")

View File

@ -82,24 +82,41 @@ function(qt_copy_framework_headers target)
set(output_dir_QPA "${output_dir}/${fw_private_module_header_dir}/qpa")
set(output_dir_RHI "${output_dir}/${fw_private_module_header_dir}/rhi")
qt_internal_module_info(module "${target}")
set(out_files)
set(out_files "")
set(in_files "")
set(copy_commands "")
foreach(type IN ITEMS PUBLIC PRIVATE QPA RHI)
set(in_files_${type} "")
set(fw_output_header_dir "${output_dir_${type}}")
foreach(hdr IN LISTS arg_${type})
get_filename_component(in_file_path ${hdr} ABSOLUTE)
get_filename_component(in_file_name ${hdr} NAME)
set(out_file_path "${fw_output_header_dir}/${in_file_name}")
add_custom_command(
OUTPUT ${out_file_path}
DEPENDS ${in_file_path}
COMMAND ${CMAKE_COMMAND} -E make_directory "${fw_output_header_dir}"
COMMAND ${CMAKE_COMMAND} -E copy "${in_file_path}" "${fw_output_header_dir}"
VERBATIM)
list(APPEND out_files ${out_file_path})
list(APPEND in_files_${type} "${in_file_path}")
endforeach()
if(in_files_${type})
list(APPEND copy_commands
COMMAND ${CMAKE_COMMAND} -E copy ${in_files_${type}} "${fw_output_header_dir}")
list(APPEND in_files ${in_files_${type}})
endif()
endforeach()
list(REMOVE_DUPLICATES out_files)
list(REMOVE_DUPLICATES in_files)
add_custom_command(
OUTPUT "${output_dir}/${fw_versioned_header_dir}" ${out_files}
DEPENDS ${in_files} ${target}_sync_headers
COMMAND
${CMAKE_COMMAND} -E copy_directory
"${module_build_interface_include_dir}/.syncqt_staging"
"${output_dir}/${fw_versioned_header_dir}"
${copy_commands}
VERBATIM
COMMENT "Copy the ${target} header files to the framework directory"
)
set_property(TARGET ${target} APPEND PROPERTY
QT_COPIED_FRAMEWORK_HEADERS "${out_files}")
endfunction()

View File

@ -11,7 +11,8 @@ if(EXISTS ${HEADER_CHECK_EXCEPTIONS})
file(READ ${HEADER_CHECK_EXCEPTIONS} header_check_exception_list)
endif()
file(TO_CMAKE_PATH "${INPUT_HEADER_FILE}" header)
get_filename_component(header "${INPUT_HEADER_FILE}" REALPATH)
file(TO_CMAKE_PATH "${header}" header)
foreach(exception IN LISTS header_check_exception_list)
file(TO_CMAKE_PATH "${exception}" exception)
if(exception STREQUAL header)

View File

@ -12,7 +12,6 @@ endfunction()
qt_set01(LINUX CMAKE_SYSTEM_NAME STREQUAL "Linux")
qt_set01(HPUX CMAKE_SYSTEM_NAME STREQUAL "HPUX")
qt_set01(ANDROID CMAKE_SYSTEM_NAME STREQUAL "Android") # FIXME: How to identify this?
qt_set01(NACL CMAKE_SYSTEM_NAME STREQUAL "NaCl") # FIXME: How to identify this?
qt_set01(INTEGRITY CMAKE_SYSTEM_NAME STREQUAL "Integrity") # FIXME: How to identify this?
qt_set01(VXWORKS CMAKE_SYSTEM_NAME STREQUAL "VxWorks") # FIXME: How to identify this?
qt_set01(QNX CMAKE_SYSTEM_NAME STREQUAL "QNX") # FIXME: How to identify this?

View File

@ -374,7 +374,9 @@ function(qtConfValidateValue opt val out_var)
endforeach()
set(${out_var} FALSE PARENT_SCOPE)
qtConfAddError("Invalid value '${val}' supplied to command line option '${opt}'.")
list(JOIN valid_values " " valid_values_str)
qtConfAddError("Invalid value '${val}' supplied to command line option '${opt}'."
"\nAllowed values: ${valid_values_str}\n")
endfunction()
function(qt_commandline_mapped_enum_value opt key out_var)

View File

@ -3,10 +3,16 @@
## Set a default build type if none was specified
# Set the QT_IS_BUILDING_QT variable so we can verify whether we are building
# Qt from source
set(QT_BUILDING_QT TRUE CACHE BOOL
# Set the QT_BUILDING_QT variable so we can verify whether we are building
# Qt from source.
# Make sure not to set it when building a standalone test, otherwise
# upon reconfiguration we get an error about qt_internal_add_test
# not being found due the if(NOT QT_BUILDING_QT) check we have
# in each standalone test.
if(NOT QT_INTERNAL_IS_STANDALONE_TEST)
set(QT_BUILDING_QT TRUE CACHE BOOL
"When this is present and set to true, it signals that we are building Qt from source.")
endif()
# Pre-calculate the developer_build feature if it's set by the user via the INPUT_developer_build
# variable when using the configure script. When not using configure, don't take the INPUT variable

View File

@ -2,4 +2,4 @@
# bypassing the Qt6 Config file, aka find_package(Qt6SpecificFoo) repated x times. But it's not
# critical.
find_package(@INSTALL_CMAKE_NAMESPACE@ @main_qt_package_version@
REQUIRED COMPONENTS @QT_REPO_KNOWN_MODULES_STRING@)
COMPONENTS @QT_REPO_KNOWN_MODULES_STRING@)

View File

@ -61,13 +61,6 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
set(is_framework FALSE)
if(NOT is_interface_lib)
get_target_property(is_framework ${target} FRAMEWORK)
if(is_framework)
qt_internal_get_framework_info(fw ${target})
get_target_property(fw_output_base_dir ${target} LIBRARY_OUTPUT_DIRECTORY)
set(framework_args "-framework"
"-frameworkIncludeDir" "${fw_output_base_dir}/${fw_versioned_header_dir}"
)
endif()
endif()
qt_internal_get_qt_all_known_modules(known_modules)
@ -151,7 +144,6 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge
-headers ${module_headers}
-stagingDir "${syncqt_staging_dir}"
-knownModules ${known_modules}
${framework_args}
${version_script_args}
)
list(JOIN syncqt_args "\n" syncqt_args_string)

View File

@ -16,6 +16,8 @@
# Custom compilation flags.
# EXTRA_LINKER_SCRIPT_CONTENT
# Extra content that should be appended to a target linker script. Applicable for ld only.
# EXTRA_LINKER_SCRIPT_EXPORTS
# Extra content that should be added to export section of the linker script.
# NO_PCH_SOURCES
# Skip the specified source files by PRECOMPILE_HEADERS feature.
function(qt_internal_extend_target target)
@ -51,6 +53,7 @@ function(qt_internal_extend_target target)
CONDITION
CONDITION_INDEPENDENT_SOURCES
COMPILE_FLAGS
EXTRA_LINKER_SCRIPT_EXPORTS
)
cmake_parse_arguments(PARSE_ARGV 1 arg
@ -260,6 +263,10 @@ function(qt_internal_extend_target target)
set_target_properties(${target} PROPERTIES
_qt_extra_linker_script_content "${arg_EXTRA_LINKER_SCRIPT_CONTENT}")
endif()
if(arg_EXTRA_LINKER_SCRIPT_EXPORTS)
set_target_properties(${target} PROPERTIES
_qt_extra_linker_script_exports "${arg_EXTRA_LINKER_SCRIPT_EXPORTS}")
endif()
endfunction()
function(qt_is_imported_target target out_var)

View File

@ -131,10 +131,12 @@ set(__qt_chainload_toolchain_file \"\${__qt_initially_configured_toolchain_file}
list(APPEND init_platform "
set(__qt_initial_c_compiler \"${CMAKE_C_COMPILER}\")
set(__qt_initial_cxx_compiler \"${CMAKE_CXX_COMPILER}\")
if(NOT DEFINED CMAKE_C_COMPILER AND EXISTS \"\${__qt_initial_c_compiler}\")
if(QT_USE_ORIGINAL_COMPILER AND NOT DEFINED CMAKE_C_COMPILER
AND EXISTS \"\${__qt_initial_c_compiler}\")
set(CMAKE_C_COMPILER \"\${__qt_initial_c_compiler}\" CACHE STRING \"\")
endif()
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS \"\${__qt_initial_cxx_compiler}\")
if(QT_USE_ORIGINAL_COMPILER AND NOT DEFINED CMAKE_CXX_COMPILER
AND EXISTS \"\${__qt_initial_cxx_compiler}\")
set(CMAKE_CXX_COMPILER \"\${__qt_initial_cxx_compiler}\" CACHE STRING \"\")
endif()")
endif()

View File

@ -53,15 +53,16 @@ function(qt_internal_create_wrapper_scripts)
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create.bat"
DESTINATION "${INSTALL_BINDIR}")
endif()
# Provide a private convenience wrapper with options which should not be propagated via the
# Provide a private convenience wrapper with options that should not be propagated via the
# public qt-cmake wrapper e.g. CMAKE_GENERATOR.
# These options can not be set in a toolchain file, but only on the command line.
# These options should not be in the public wrapper, because a consumer of Qt might want to
# build their CMake app with the Unix Makefiles generator, while Qt should be built with the
# Ninja generator.
# The private wrapper is more conveient for building Qt itself, because a developer doesn't need
# to specify the same options for each qt module built.
set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"")
# Ninja generator. In a similar vein, we do want to use the same compiler for all Qt modules,
# but not for user applications.
# The private wrapper is more convenient for building Qt itself, because a developer doesn't
# need to specify the same options for each qt module built.
set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\" -DQT_USE_ORIGINAL_COMPILER=ON")
if(generate_unix)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in"
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-cmake-private" @ONLY
@ -202,6 +203,22 @@ function(qt_internal_create_wrapper_scripts)
elseif(CMAKE_BUILD_TYPE)
set(__qt_configured_configs "${CMAKE_BUILD_TYPE}")
endif()
if(
# Skip stripping pure debug builds so it's easier to debug issues in CI VMs.
(NOT QT_FEATURE_debug_and_release
AND QT_FEATURE_debug
AND NOT QT_FEATURE_separate_debug_info)
# Skip stripping on MSVC because ${CMAKE_STRIP} might contain a MinGW strip binary
# and the breaks the linker version flag embedded in the binary and causes Qt Creator
# to mis-identify the Kit ABI.
OR MSVC
)
set(__qt_skip_strip_installed_artifacts TRUE)
else()
set(__qt_skip_strip_installed_artifacts FALSE)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in"
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}" @ONLY)
qt_install(FILES "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}"
@ -209,6 +226,7 @@ function(qt_internal_create_wrapper_scripts)
qt_internal_create_qt_configure_tests_wrapper_script()
qt_internal_install_android_helper_scripts()
qt_internal_create_qt_configure_redo_script()
endfunction()
function(qt_internal_create_qt_configure_tests_wrapper_script)
@ -231,7 +249,7 @@ function(qt_internal_create_qt_configure_tests_wrapper_script)
# The script takes a path to the repo for which the standalone tests will be configured.
set(script_name "qt-internal-configure-tests")
set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON")
set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON -DQT_USE_ORIGINAL_COMPILER=ON")
file(RELATIVE_PATH relative_path_from_libexec_dir_to_bin_dir
${__qt_libexec_dir_absolute}
@ -262,3 +280,41 @@ function(qt_internal_install_android_helper_scripts)
qt_copy_or_install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/util/android/android_emulator_launcher.sh"
DESTINATION "${destination}")
endfunction()
# Create a shell wrapper script to reconfigure Qt with the original configure arguments and
# any additional ones passed.
#
# Removes CMakeCache.txt and friends, either manually, or using CMake's --fresh.
#
# The script is created in the root of the build dir and is called config.redo
# It has the same contents as the 'config.status' script we created in qt 5.
function(qt_internal_create_qt_configure_redo_script)
set(input_script_name "qt-internal-config.redo")
set(input_script_path "${CMAKE_CURRENT_SOURCE_DIR}/libexec/${input_script_name}")
# We don't use QT_BUILD_DIR because we want the file in the root of the build dir in a top-level
# build.
set(output_script_name "config.redo")
set(output_path "${CMAKE_BINARY_DIR}/${output_script_name}")
if(QT_SUPERBUILD)
set(configure_script_path "${Qt_SOURCE_DIR}")
else()
set(configure_script_path "${QtBase_SOURCE_DIR}")
endif()
string(APPEND configure_script_path "/configure")
# Used in the file contents.
file(TO_NATIVE_PATH "${configure_script_path}" configure_path)
if(CMAKE_HOST_UNIX)
string(APPEND input_script_path ".in")
set(newline_style "LF")
else()
string(APPEND input_script_path ".bat.in")
string(APPEND output_path ".bat")
set(newline_style "CRLF")
endif()
configure_file("${input_script_path}" "${output_path}" @ONLY NEWLINE_STYLE ${newline_style})
endfunction()