Add CMake variable to allow use of DESTDIR when installing examples
in a standalone example build and skipping the fake prefix that would
be otherwise used. Similar variable is already used for tests.
Pick-to: 6.9 6.8
Change-Id: I427cbb5c198f8e89b1685792b7c1d90413213254
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When QT_INTERNAL_EXAMPLES_INSTALL_PREFIX is set, the build system
should ignore the DESTDIR env var when installing examples. Otherwise
the examples will still be installed into a location where the Coin
agent will archive the files, and thus blow up the package size,
especially if each example contains deployed Qt libraries.
Backup and temporarily unset the DESTDIR env var while example
installation is in progress.
Amends 02cb165ef8050230b477358e4136e9f0acd83eb6
Amends 7694b01aafd52b7064161b2f8c9a98cd330d24d3
Pick-to: 6.8
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ibe24a88dd672d246b579d815a813dd042f60e6a6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
There was a typo in the original change, which caused none of the qml
plugins in a prefix per-repo build being picked up.
Amends 06fef6219e992489dae15e9851725e1675ff0bf6
Pick-to: 6.7 6.8
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ibf14d9e0cbb0302c69d32071f4ba090f24a5798d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
When building examples as part of Qt in the CI, it's best to skip
running deployment for all examples to save resources
(space and time).
Add a QT_DEPLOY_MINIMAL_EXAMPLES option similar to our
QT_BUILD_MINIMAL_STATIC_TESTS option, which will set
QT_INTERNAL_SKIP_DEPLOYMENT at the root examples directory scope, to
skip deployment for all examples.
Each example can then opt into the minimal subset by unsetting the
QT_INTERNAL_SKIP_DEPLOYMENT variable before its
qt_internal_add_example call.
Add Coin instructions to enable this option when building our examples
in the CI.
Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: I2efcda455b400c27fe1efd1bcf81b133137fa2d1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The current deployment api implementation sets the value of
QT_DEPLOY_PREFIX based on CMAKE_INSTALL_PREFIX, if no QT_DEPLOY_PREFIX
was previously specified.
This does not work properly when multiple examples are placed in the
same subdirectory and are using deployment api.
Make sure to unset the QT_DEPLOY_PREFIX for each
qt_internal_add_example call, so that a correct prefix is computed for
each example, based on the modified CMAKE_INSTALL_PREFIX value that we
set for each example.
Pick-to: 6.7
Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
To ensure examples can be built as ExternalProjects, the example
subdirectories need to be added via qt_internal_add_example rather
than just add_subdirectory.
qt_internal_add_example is also needed for correct installation of
example sources.
To catch examples that are still not added via
qt_internal_add_example, set a QT_WARN_ABOUT_EXAMPLE_ADD_SUBDIRECTORY
variable at the top of the examples/CMakeLists.txt directory scope
and show a warning in qt_add_executable whenever that variable is
TRUE.
Calls of qt_internal_add_example will set the variable to FALSE,
making sure the warning is not shown for properly added examples.
This is limited to developer builds and can be opted out of via the
QT_NO_WARN_ABOUT_EXAMPLE_ADD_SUBDIRECTORY_WARNING variable.
qt_add_executable is used as the 'hook' for showing the error, because
that is the most likely function to be used in examples.
We don't use qt_standard_project_setup in all projects yet, so we
don't want to use that one.
Task-number: QTBUG-90820
Task-number: QTBUG-123096
Change-Id: I7a0b0b2cc60c70903db03b56c06494c127a62420
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Make sure to consider all qt_prefixes for adjusting
QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES with locations where qml plugin
config files might be present.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I5a7eec434635db1953871d735e2420c331ccee48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When building EP examples for a repo that defines a bundled library,
we need to make sure the relevant FindWrapBundledFooConfigExtra.cmake
file is found when looking up dependencies.
For a prefix build, that file is placed in the build dir of the repo.
Use the list of qt_prefixes that includes the build dir of the repo,
append lib/cmake/Qt6 to it and pass that as additional values to
the CMAKE_MODULE_PATH variable of the external project.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I85d5f360380856fcfb8be7235b8365dcf15aa0c0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Some examples depend on FindWrapFoo.cmake scripts that are part of
a repo. An example is qtgrpc with FindWrapProtoc.cmake.
These need to be available when building external project examples in
a prefix build where the repo is not installed yet, and thus the
source dir FindWrap scripts need to be used instead.
Make sure to pass the value of CMAKE_MODULE_PATH to the external
projects to ensure these scripts are found. CMAKE_MODULE_PATH is
populated by qt_set_up_build_internals_paths as part of the
qt repo build.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I3e977919bc137ed60e8eb9300625e5d8b87b373e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
In some repos we need to be able to pass extra cache variables to find
3rd party packages when building examples as external projects.
Introduce QT_EXAMPLE_CMAKE_VARS_TO_PASS to allow passing vars like
OpenSSL_ROOT or Protobuf_ROOT if they are set in the repo project.
It should be noted that QT_EXAMPLE_CMAKE_VARS_TO_PASS expects a
special syntax for its values, of the from VAR_NAME:CMAKE_TYPE, due
to the pre-existing implementation on how we pass variables
to ExternalProject.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ie3e74d4fde106f947d12e51d27e41a310157aab6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Move most of the code into two new files:
- QtBuildRepoHelpers.cmake
- QtBuildRepoExamplesHelpers.cmake
Task-number: QTBUG-86035
Change-Id: I48c4e7c64f0ffb600118172b8e69b26018f36ffb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>