14 Commits

Author SHA1 Message Date
Tim Blechmann
7a62c96238 CMake: add licenseRule.json to IDE projects
Some repos have licenseRule.json files. Adding them to the IDE projects.

Pick-to: 6.7
Change-Id: I7fdc054d244d48e3343866775671d8f4f4c9390b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
2024-04-24 16:41:23 +08:00
Tim Blechmann
bd2dc0c3ed CMake: split _extra_files targets
Separate config.tests, coin, cmake, licenses and changelogs into
independent targets to keep the IDE projects more organized.

Pick-to: 6.7
Change-Id: Ie33d45799621c2d7ec6f022ffcfac132ac4c7b94
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-12 08:36:05 +08:00
Tim Blechmann
003a191152 cmake: add _extra_files IDE target from heuristics
Lots of files in the repos are not included into the generated IDE
projects. Therefore we add utility targets (custom targets), which are
populated by glob patterns, which should fit most files that are found
in qt's subprojects.

Pick-to: 6.7
Change-Id: I1b731e65f8db319d3cec817eea5c23a1eeaefb22
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-12 08:36:01 +08:00
Alexey Edelev
6760bae2fa Suppress the warning about unused QT_INTERNAL_CALLED_FROM_CONFIGURE
Add the dummy check if the variable is defined to suppress the warning.

Pick-to: 6.7
Change-Id: If3bb0ef6a2587693c0ec898ceb3080ebfc1e82a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-04-11 01:27:32 +02:00
Alexandru Croitor
270315e019 CMake: Fix finding standalone parts config file for yocto
When building standalone tests of qtsvg targeting yocto, the
standalone parts config file was not found.

That's because it specifies a new CMAKE_STAGING_PREFIX for each built
repo, and the QtSvgTestsConfig.cmake file will be located there,
rather than in QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, where
the QtBuildInternalsConfig.cmake file is.

So in this case, we always have to prefer looking into
CMAKE_STAGING_PREFIX for the file.

Amends 62905163bf887c2c2c9ba7edcd64c96d237a6e95

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-19 16:04:59 +01:00
Alexandru Croitor
62905163bf CMake: Allow building all examples as standalone just like tests
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>
2024-03-14 11:44:16 +01:00
Alexandru Croitor
dd052a0a01 CMake: Warn when examples are not added via qt_internal_add_example
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>
2024-03-11 13:48:23 +01:00
Joerg Bornemann
55d81b3eff CMake: Remove qt_internal_compute_features_from_possible_inputs
This function calculated the values of the features 'no-prefix' and
'developer-build' from INPUT_* values. Since configure directly
translates -no-prefix and -developer-build to FEATURE_no_prefix and
FEATURE_developer_build, we can remove the function.

Task-number: QTBUG-120529
Change-Id: Ide1fa61af175d8f6a6aa6363dfdfa94912836345
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-13 20:11:21 +01:00
Tim Blechmann
25b89f2c88 cmake: build repo helpers - fine-grained test/example options
the tests/examples could only be enabled globally. when working on a
specific repo, it's beneficial to disable tests/examples for other
projects to reduce project sizes (and cmake configure/generate times)

Change-Id: I0026ba87b667d427043cc8eb1baa6c28b2046dd7
Pick-to: 6.7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-08 23:30:29 +08:00
Alexey Edelev
161c2f9544 Add the the implicit promotion to global for Qt platform targets
Bundled 3rdparty libraries link Qt platform targets implicitly, which
lead to the dependency resolution when the library is used by another
targets. For qtbase this works just fine since all platform targets
are not imported and they are used from a build tree. But in case if
3rdparty library is built as part of Qt repo different from qtbase
platform targets are imported and trigger the global promotion in
CMake. Usually qt_find_package for the 3rdparty libraries is called
somewhere in src/... directory and since Qt::Platform* targets are
already created in the top-level repo CMakeLists.txt by the
find_package(Qt ...) call, this leads to an error.

The propsed fix forces the global promotion of Qt platform targets
as soon as they created by the one of the initial find_package(Qt ...)
calls.

Change-Id: Iceb53f9ecccbdc438f9bc3bcc836583cfd4de535
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-31 19:20:06 +01:00
Alexey Edelev
0d7cda9cda Fix encapsulation of qt_build_internals_add_toplevel_targets
The function uses external non-cache variable that is set in different
cmake macro. It's better to pass the value as argument.

Pick-to: 6.5 6.6 6.7
Change-Id: I282bd506cf2dcd998a0ddd7deaad244fab34a8db
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-12-22 06:35:09 +01:00
Alexandru Croitor
2b1f233863 CMake: Mostly unify includes into a single location
Make the QtBuildRepoHelpers and QtBuildRepoExamplesHelpers files
that were previously loaded as part of BuildInternals package instead
be loaded when qt_internal_include_all_helpers is called.

Load all the helpers as soon as find_package(QtBuildInternals) is
called rather than when qt_build_repo() is called.

This is a behavior change, but because including the Qt's Helpers
should have no side-effects aside from defining functions,
it should be fine.

This lets us have a unified location where to include Helpers files,
instead of thinking whether it needs to be done in QtBuildInternals or
in QtBuildHelpers or some other place.

Move also some additional inclusions into the same function.

Note that including some upstream CMake files like CMakeFindBinUtils
does have side-effects, but we've been doing it already anyway,
so moving it to the top should not make a difference because any
modifications we would do to the globally assigned variables would
have come later when we actually called our own functions.

Task-number: QTBUG-86035
Change-Id: I33f36f7e8db69d504c34a4d4a094b98f6fa50ee4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-27 19:53:42 +01:00
Alexandru Croitor
b8f9252507 CMake: Move qt_internal_read_repo_dependencies into QtBuildRepoHelpers
Previously qt_internal_read_repo_dependencies had to be defined
before QtBuildInternalsExtra.cmake was included because the file
called the function.

Instead of calling the function in QtBuildInternalsExtra.cmake, just
call it later after the Helpers have been loaded. We can do this
because the function is always called unconditionally, so no point in
doing it in the generated file.
This lets us move the function into the QtBuildRepoHelpers.

Amends 98e8180e56322ce065e39cc1ef1d65b54caa8c25
Amends a804ac3d881fb036619f323f64e778a9e00b181d

Task-number: QTBUG-86035
Change-Id: Idffed8f2eb9d728c779b77b31eba0d24d85752ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-27 19:53:42 +01: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