The _qt_internal_finalize_batch function had a bunch of problems,
style-wise and function-wise:
- it called find_package(Qt6) in its body, which broke when
configuring qtbase with in-tree tests
- it constantly rewrote the merged blacklist file on each
reconfiguration
- it used file(WRITE) to concatenate content
- it was in the public API file
The changes are:
- Move the function to the internal test helpers file.
- Change it to use qt_configure_file instead of file(WRITE).
- Call it at the end of the qt_build_tests for a repo, or at the end
of configuring a super build, instead of relying on a finalizer.
- Remove the find_package call. The reason this was added in the first
place, was to populate the __qt_core_macros_module_base_dir variable
so that qt_internal_add_resource configure_file call doesn't fail in
standalone tests build.
The variable was unset because the finalized function was called in
the top level directory scope, whereas the very first find_package
call was in the tests/ scope, meaning the variable was empty.
This is still a problem in the top-level build where the tests scope
and the top-level scope are different. Work around it by relying on
a global property to reset the value if it's empty.
Amends 6a9e89121d7766a34c4281d298057bfbe8af36b3
Pick-to: 6.8
Change-Id: Id6fe41ee86d09b8118bea52cac8a59965d7ecb9e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Assuming the DATADIR is a good destination for these files. The behavior
is disabled by default, set QT_INSTALL_CONFIG_INFO_FILES to TRUE to
enable it.
Task-number: QTBUG-78749
Change-Id: Ief81b856265ad028714e1d6651239c05aed1a5c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Introduce a new libexec/qt-internal-configure-examples script that
allows to configure and build "standalone examples" just like
"standalone tests".
This is a prerequisite for using deployment api in examples for prefix
builds, otherwise deployment api gets confused not finding various
information that it expects from an installed qt.
Because the various conditions in the build system for standalone
examples are similar to standalone tests, introduce a new
QT_BUILD_STANDALONE_PARTS variable and use that in the conditions.
The variable should not be set by the user, and is instead set by the
build system whenever QT_BUILD_STANDALONE_TESTS/EXAMPLES is set.
Unfortunately due to no common file being available before the first
project() call, in qtbase builds, per-repo builds and top-level builds,
we need to duplicate the code for setting QT_BUILD_STANDALONE_PARTS for
all three cases.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ia40d03a0e8f5142abe5c7cd4ff3000df4a5f7a8a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Now that the top-level build calls qt_internal_qt_configure_end
itself, we don't need to call it in qt_print_build_instructions.
Pick-to: 6.6
Change-Id: I906ee7bc1aed3b597049b5996a41dd298175343c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
It makes sense (in my opinion) to have the top-level CMakeLists.txt
to include and call certain commands that should be controlled by
qtbase, to avoid submodule update difficulties when we want to do
changes in qtbase that shouldn't concern the top-level file.
Create cmake/QtBaseTopLevelHelpers.cmake and move some pre-existing
code from the top-level CMakeLists.txt into separate functions that
are defined in qtbase.
This file will be included in the top-level one and said commands will
be called there.
This also prepares for qt_print_build_instructions not call
qt_internal_qt_configure_end anymore, because it will be called
by the top-level project.
Pick-to: 6.6
Change-Id: I1fe3490001cf441d742c64b2ef1f267cd4362f6a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>