3 Commits

Author SHA1 Message Date
Alexandru Croitor
e67704c40f CMake: Allow passing extra variables to external project examples
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>
(cherry picked from commit 43d0c5ed6ef666b4ef9f33c018240f551fb6ebae)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:56:57 +01:00
Alexandru Croitor
cf932db57f CMake: Recompute QT_DEPLOY_PREFIX for each built example
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.

Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c5d0e93199beea314e4e4607c8ef5f7c29162666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 19:41:43 +00:00
Alexandru Croitor
720b8ee673 CMake: Split and refactor QtBuildInternalsConfig.cmake
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>
2023-11-27 19:53:42 +01:00