2022-07-05 11:26:52 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2022-08-19 13:21:34 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 11:26:52 +00:00
|
|
|
|
2020-10-12 08:55:18 +00:00
|
|
|
# Creates and installs the following wrapper CMake scripts:
|
|
|
|
# qt-make
|
|
|
|
# qt-cmake-private
|
|
|
|
# qt-configure-module
|
|
|
|
# qt-cmake-private-install
|
2021-11-26 22:27:23 +00:00
|
|
|
# And other helper scripts.
|
2020-10-12 08:55:18 +00:00
|
|
|
function(qt_internal_create_wrapper_scripts)
|
|
|
|
# Provide a convenience cmake wrapper.
|
2022-03-02 16:38:38 +00:00
|
|
|
|
|
|
|
if(QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS)
|
|
|
|
set(generate_unix TRUE)
|
|
|
|
set(generate_non_unix TRUE)
|
|
|
|
elseif(CMAKE_HOST_UNIX)
|
|
|
|
set(generate_unix TRUE)
|
|
|
|
else()
|
|
|
|
set(generate_non_unix TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(generate_unix)
|
2022-05-06 11:38:05 +00:00
|
|
|
if(IOS)
|
|
|
|
set(infix ".ios")
|
|
|
|
else()
|
|
|
|
set(infix "")
|
|
|
|
endif()
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake${infix}.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake" @ONLY
|
2022-05-06 11:38:05 +00:00
|
|
|
NEWLINE_STYLE LF)
|
2020-10-12 08:55:18 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
2022-03-02 16:38:38 +00:00
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.bat.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake.bat" @ONLY
|
|
|
|
NEWLINE_STYLE CRLF)
|
2020-10-12 08:55:18 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake.bat"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
|
|
|
|
2023-01-18 21:06:08 +00:00
|
|
|
if(generate_unix)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-create.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create" @ONLY
|
|
|
|
NEWLINE_STYLE LF)
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-create.bat.in"
|
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create.bat" @ONLY
|
|
|
|
NEWLINE_STYLE CRLF)
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create.bat"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
2023-05-23 08:56:36 +00:00
|
|
|
# Provide a private convenience wrapper with options that should not be propagated via the
|
2020-10-12 08:55:18 +00:00
|
|
|
# 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
|
2023-05-23 08:56:36 +00:00
|
|
|
# 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")
|
2022-03-02 16:38:38 +00:00
|
|
|
if(generate_unix)
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in"
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-cmake-private" @ONLY
|
2022-05-10 12:38:28 +00:00
|
|
|
NEWLINE_STYLE LF)
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-cmake-private"
|
|
|
|
DESTINATION "${INSTALL_LIBEXECDIR}")
|
2022-03-02 16:38:38 +00:00
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.bat.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private.bat" @ONLY
|
|
|
|
NEWLINE_STYLE CRLF)
|
2022-03-02 16:38:38 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private.bat"
|
2020-10-12 08:55:18 +00:00
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
|
|
|
unset(__qt_cmake_extra)
|
|
|
|
|
|
|
|
# Provide a script to configure Qt modules.
|
|
|
|
if(QT_WILL_INSTALL)
|
2020-10-29 09:22:03 +00:00
|
|
|
set(__relative_path_to_cmake_scripts_dir
|
2020-10-12 08:55:18 +00:00
|
|
|
"${__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir}")
|
|
|
|
else()
|
2020-10-29 09:22:03 +00:00
|
|
|
file(RELATIVE_PATH __relative_path_to_cmake_scripts_dir
|
2020-10-12 08:55:18 +00:00
|
|
|
"${__qt_bin_dir_absolute}" "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
endif()
|
2020-10-29 09:22:03 +00:00
|
|
|
file(TO_NATIVE_PATH "${__relative_path_to_cmake_scripts_dir}"
|
|
|
|
__relative_path_to_cmake_scripts_dir)
|
2022-03-02 16:38:38 +00:00
|
|
|
if(generate_unix)
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.in"
|
2022-12-12 14:08:41 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module" @ONLY
|
2022-05-10 12:38:28 +00:00
|
|
|
NEWLINE_STYLE LF)
|
2022-12-12 14:08:41 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
2022-03-02 16:38:38 +00:00
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-configure-module.bat.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat" @ONLY
|
|
|
|
NEWLINE_STYLE CRLF)
|
2020-10-12 08:55:18 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-configure-module.bat"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
|
|
|
endif()
|
2020-10-29 09:22:03 +00:00
|
|
|
unset(__relative_path_to_cmake_scripts_dir)
|
2020-10-12 08:55:18 +00:00
|
|
|
|
|
|
|
# Provide a private convenience wrapper to configure and build one or more standalone tests.
|
|
|
|
# Calling CMake directly on a Qt test project won't work because the project does not call
|
|
|
|
# find_package(Qt...) to get all dependencies like examples do.
|
|
|
|
# Instead a template CMakeLists.txt project is used which sets up all the necessary private bits
|
|
|
|
# and then calls add_subdirectory on the provided project path.
|
2022-12-09 09:47:17 +00:00
|
|
|
set(__qt_cmake_standalone_test_name "qt-cmake-standalone-test")
|
|
|
|
if(generate_unix)
|
|
|
|
set(__qt_cmake_standalone_test_libexec_path
|
|
|
|
"${INSTALL_LIBEXECDIR}/${__qt_cmake_standalone_test_name}")
|
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
|
|
|
set(__qt_cmake_standalone_test_bin_path
|
|
|
|
"${INSTALL_BINDIR}/${__qt_cmake_standalone_test_name}")
|
|
|
|
endif()
|
2022-08-12 14:33:16 +00:00
|
|
|
|
|
|
|
# Configuring a standalone test on iOS should use the Xcode generator, but qt-cmake-private uses
|
|
|
|
# the generator that was used to build Qt itself (e.g. Ninja).
|
|
|
|
# Use qt-cmake instead, which does use the Xcode generator since Qt 6.2.5, 6.3.1, 6.4.
|
|
|
|
if(IOS)
|
|
|
|
set(__qt_cmake_private_path
|
|
|
|
"${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake")
|
|
|
|
else()
|
2022-12-09 09:47:17 +00:00
|
|
|
if(generate_unix)
|
|
|
|
set(__qt_cmake_private_path
|
|
|
|
"${QT_STAGING_PREFIX}/${INSTALL_LIBEXECDIR}/qt-cmake-private")
|
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
|
|
|
set(__qt_cmake_private_path
|
2022-12-13 08:59:31 +00:00
|
|
|
"${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private")
|
2022-12-09 09:47:17 +00:00
|
|
|
endif()
|
2022-08-12 14:33:16 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-12 08:55:18 +00:00
|
|
|
set(__qt_cmake_standalone_test_path
|
|
|
|
"${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}")
|
|
|
|
|
2020-11-23 13:15:04 +00:00
|
|
|
if(QT_WILL_INSTALL)
|
|
|
|
# Need to prepend the staging prefix when doing prefix builds, because the build internals
|
|
|
|
# install dir is relative in that case..
|
|
|
|
qt_path_join(__qt_cmake_standalone_test_path
|
|
|
|
"${QT_STAGING_PREFIX}"
|
|
|
|
"${__qt_cmake_standalone_test_path}")
|
|
|
|
endif()
|
2020-11-13 17:46:49 +00:00
|
|
|
|
2022-03-02 16:38:38 +00:00
|
|
|
if(generate_unix)
|
2022-12-09 09:47:17 +00:00
|
|
|
get_filename_component(rel_base_path
|
|
|
|
"${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_libexec_path}"
|
|
|
|
DIRECTORY)
|
|
|
|
|
|
|
|
file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
|
|
|
|
"${__qt_cmake_private_path}")
|
|
|
|
file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
|
|
|
|
"${__qt_cmake_standalone_test_path}")
|
|
|
|
|
2020-10-12 08:55:18 +00:00
|
|
|
set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
|
2020-11-13 17:46:49 +00:00
|
|
|
set(__qt_cmake_standalone_test_script_relpath "SCRIPT_DIR=`dirname $0`")
|
|
|
|
string(PREPEND __qt_cmake_private_relpath "exec $SCRIPT_DIR/")
|
|
|
|
string(PREPEND __qt_cmake_standalone_test_relpath "$SCRIPT_DIR/")
|
2020-10-12 08:55:18 +00:00
|
|
|
set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"")
|
2022-03-02 16:38:38 +00:00
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-standalone-test.in"
|
2022-12-09 09:47:17 +00:00
|
|
|
"${QT_BUILD_DIR}/${__qt_cmake_standalone_test_libexec_path}"
|
2022-05-10 12:38:28 +00:00
|
|
|
NEWLINE_STYLE LF)
|
2022-12-09 09:47:17 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_libexec_path}"
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
DESTINATION "${INSTALL_LIBEXECDIR}")
|
2022-03-02 16:38:38 +00:00
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
2022-12-09 09:47:17 +00:00
|
|
|
get_filename_component(rel_base_path
|
|
|
|
"${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_bin_path}"
|
|
|
|
DIRECTORY)
|
|
|
|
|
|
|
|
file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
|
|
|
|
"${__qt_cmake_private_path}")
|
|
|
|
file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
|
|
|
|
"${__qt_cmake_standalone_test_path}")
|
|
|
|
|
2020-10-12 08:55:18 +00:00
|
|
|
set(__qt_cmake_standalone_test_os_prelude "@echo off")
|
2020-11-13 17:46:49 +00:00
|
|
|
set(__qt_cmake_standalone_test_script_relpath "set SCRIPT_DIR=%~dp0")
|
|
|
|
string(APPEND __qt_cmake_standalone_test_bin_path ".bat")
|
|
|
|
string(APPEND __qt_cmake_private_relpath ".bat")
|
|
|
|
string(PREPEND __qt_cmake_private_relpath "%SCRIPT_DIR%")
|
|
|
|
string(PREPEND __qt_cmake_standalone_test_relpath "%SCRIPT_DIR%")
|
2020-10-12 08:55:18 +00:00
|
|
|
set(__qt_cmake_standalone_passed_args "%* -DPWD=\"%CD%\"")
|
2022-03-02 16:38:38 +00:00
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-standalone-test.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${__qt_cmake_standalone_test_bin_path}"
|
|
|
|
NEWLINE_STYLE CRLF)
|
2022-03-02 16:38:38 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_bin_path}"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
2020-10-12 08:55:18 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Create an installation script that the CI can use to handle installation for both
|
|
|
|
# single and multiple configurations.
|
|
|
|
set(__qt_cmake_install_script_name "qt-cmake-private-install.cmake")
|
|
|
|
if(CMAKE_CONFIGURATION_TYPES)
|
|
|
|
set(__qt_configured_configs "${CMAKE_CONFIGURATION_TYPES}")
|
|
|
|
elseif(CMAKE_BUILD_TYPE)
|
|
|
|
set(__qt_configured_configs "${CMAKE_BUILD_TYPE}")
|
|
|
|
endif()
|
2023-10-16 16:04:06 +00:00
|
|
|
|
|
|
|
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()
|
2020-10-12 08:55:18 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in"
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}" @ONLY)
|
|
|
|
qt_install(FILES "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}"
|
|
|
|
DESTINATION "${INSTALL_LIBEXECDIR}")
|
2020-10-23 12:37:58 +00:00
|
|
|
|
|
|
|
qt_internal_create_qt_configure_tests_wrapper_script()
|
2023-09-01 14:39:59 +00:00
|
|
|
qt_internal_create_qt_configure_redo_script()
|
2020-10-23 12:37:58 +00:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(qt_internal_create_qt_configure_tests_wrapper_script)
|
2022-03-02 16:38:38 +00:00
|
|
|
if(QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS)
|
|
|
|
set(generate_unix TRUE)
|
|
|
|
set(generate_non_unix TRUE)
|
|
|
|
elseif(CMAKE_HOST_UNIX)
|
|
|
|
set(generate_unix TRUE)
|
|
|
|
else()
|
|
|
|
set(generate_non_unix TRUE)
|
|
|
|
endif()
|
|
|
|
|
2020-10-23 12:37:58 +00:00
|
|
|
# Create a private wrapper script to configure and build all standalone tests.
|
|
|
|
#
|
|
|
|
# The script uses qt-cmake instead of qt-cmake-private on purpose. That's to ensure we build
|
|
|
|
# only one configuration of tests (e.g RelWithDebInfo only) when Qt is configured with more
|
|
|
|
# than one configuration (RelWithDebInfo;Debug).
|
|
|
|
# Meant to be used by our CI instructions.
|
|
|
|
#
|
|
|
|
# The script takes a path to the repo for which the standalone tests will be configured.
|
|
|
|
set(script_name "qt-internal-configure-tests")
|
|
|
|
|
2023-05-23 08:56:36 +00:00
|
|
|
set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON -DQT_USE_ORIGINAL_COMPILER=ON")
|
2021-04-26 13:45:29 +00:00
|
|
|
|
|
|
|
file(RELATIVE_PATH relative_path_from_libexec_dir_to_bin_dir
|
|
|
|
${__qt_libexec_dir_absolute}
|
|
|
|
${__qt_bin_dir_absolute})
|
|
|
|
file(TO_NATIVE_PATH "${relative_path_from_libexec_dir_to_bin_dir}"
|
|
|
|
relative_path_from_libexec_dir_to_bin_dir)
|
|
|
|
|
2022-03-02 16:38:38 +00:00
|
|
|
if(generate_unix)
|
2021-04-26 13:45:29 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libexec/${script_name}.in"
|
2022-05-10 12:38:28 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${script_name}" @ONLY
|
|
|
|
NEWLINE_STYLE LF)
|
2021-04-26 13:45:29 +00:00
|
|
|
|
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${script_name}"
|
|
|
|
DESTINATION "${INSTALL_LIBEXECDIR}")
|
2022-03-02 16:38:38 +00:00
|
|
|
endif()
|
|
|
|
if(generate_non_unix)
|
2021-04-26 13:45:29 +00:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libexec/${script_name}.bat.in"
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/${script_name}.bat" @ONLY
|
2022-05-10 12:38:28 +00:00
|
|
|
NEWLINE_STYLE CRLF)
|
2021-04-26 13:45:29 +00:00
|
|
|
|
Move Some of the Private CMake Helper Scripts from `bin/` to `libexec/`
After this change, private CMake scripts are mostly live in
`libexec/`, except the `qt-cmake` which will stay in `bin/`.
This doesn't affect the Windows configuration.
- `qt-cmake` stays in `bin/`
- `qt-configure-module` moves into `libexec/`
- `qt-cmake-private` moves into `libexec/`
- `qt-cmake-private-install.cmake` moves into `libexec/`
- `qt-cmake-standalone-test` moves into `libexec/`
- `qt-internal-configure-test` moves into `libexec/`
In cases where `QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS` is set to
ON, e.g., ANDROID, WASM, both Batch and Bash files will be generated
and placed in `bin/` and `libexec/` accordingly; in both cases,
qt-cmake and qt-cmake.bat will be in `bin/` anyway.
[ChangeLog][CMake] The private Qt CMake scripts, i.e.,
qt-configure-module, qt-cmake-private, qt-cmake-private-install.cmake,
qt-cmake-standalone-test and qt-internal-configure-test were moved
into $prefix/libexec on Unix platforms.
Fixes: QTBUG-107621
Change-Id: Ic4f4ec85f64d2ede0e208bca928959e30be906a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-17 13:50:18 +00:00
|
|
|
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${script_name}.bat"
|
|
|
|
DESTINATION "${INSTALL_BINDIR}")
|
2020-10-23 12:37:58 +00:00
|
|
|
endif()
|
2020-10-12 08:55:18 +00:00
|
|
|
endfunction()
|
2023-09-01 14:39:59 +00:00
|
|
|
|
|
|
|
# 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()
|