36 Commits

Author SHA1 Message Date
Alexey Edelev
1f10cd4b45 Introduce _qt_internal_append_cmake_configure_depends
The function append the unique entries to the CMAKE_CONFIGURE_DEPENDS
property. This suppress the ninja recompat issue, which complains
about the duplicated entries in that come from the
CMAKE_CONFIGURE_DEPENDS property. It's likely the CMake issue, but
we may work around it.

Pick-to: 6.8 6.9 6.10
Change-Id: I2f10834b0dca3d2aa08fe13fba69849e97fa77d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-06-12 18:58:33 +02:00
Alexandru Croitor
7542aaea60 CMake: Improve error reporting for failed linker no undefined flag
Capture the output of the check_cxx_source_compiles calls in
qt_internal_add_link_flags_no_undefined like we do for
qt_config_compile_test.

Amends 3334a77ecfb792fba0144e99887f11cd0fa2506d

Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-137198
Change-Id: Ic7dd4eae0ac1af0f8293f2ce285d2987e4e26249
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-06-04 19:08:13 +02:00
Samuli Piippo
c18a773355 CMake: fix __qt_internal_collect_additional_module_paths
When the additional path did not point to cmake path, the
loop was using non-existing variable.

Pick-to: 6.9 6.8
Change-Id: Ie9599231599c3b90125825414956e345634c85ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-20 16:27:53 +00:00
Alexey Edelev
5c30ae2c9f Add support for _qt_internal_configure_file(GENERATE ... INPUT
Allow generating files from template file. The signature first
expands the '@' wrapped variables in template file and then generates
the resulting file using file(GENERATE command.

Pick-to: 6.8 6.9
Change-Id: I0b4cf557da1d5161ffcde1c44aea98c440427980
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-04-25 02:22:20 +02:00
Alexey Edelev
6e536aba73 Ensure that plugin class name is a valid C indentifier
We should prevent using the invalid plugin class names at CMake
configure stage already, so users receive the early error.

Fixes: QTBUG-135860
Change-Id: I259539f6cce70a035ccf458a62d9e5a02f238ef8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-04-23 18:49:53 +02:00
Alexey Edelev
1c886724bc Introduce _qt_internal_configure_file
The function is the internal public counterpart of the
qt_configure_file command, but also supports two modes:
GENERATE and CONFIGURE. The CONFIGURE mode is plain replacement
of file(CONFIGURE or configure_file command depending of specified
arguments.

In the GENERATE mode the function allows using the generator
expressions when evaluating the CONTENT. The function doesn't support
INPUT argument as its counterpart(there are no limitations, author left
this unimplemented).

Pick-to: 6.8 6.9
Change-Id: I9bef2265210404113596db95085b6e0d5f03ae13
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-04-04 17:23:42 +02:00
Alexey Edelev
d9ce5184c2 Dealias the target implicitly in _qt_internal_add_transitive_property
Ensure the target is not an ALIAS target when adding the
transitive properties.

Pick-to: 6.8 6.9
Change-Id: Ic9cb4f1a6e110596e430176cfa9b7f742d2c3446
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-04-04 17:23:14 +02:00
Alexandru Croitor
a20f281212 CMake: Fix CMP0177 warnings by adjusting qt_join_path
INSTALL_DATADIR and INSTALL_ARCHDATADIR have the value "." by default.

CMP0177 in CMake 3.31 now warns when paths that have "." as a
component are passed to install().

To avoid the warning, change the implementation of qt_path_join, to
filter out "." components.

That way all install() calls that build up their paths via
qt_path_join() will avoid the warning.

Pick-to: 6.8 6.9
Change-Id: Ib82aa9fe6b5d32e374e8b1acf05402312b6dbe1a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-04-03 20:00:13 +02:00
Cristian Le
9d78275f22 Copy qt_set01 to a central location
Change-Id: I05b3ef4d02dd1f8583eea9960c3776409f2f3b2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-02-28 17:49:25 +01:00
Cristian Le
0630f055b8 Add _qt_internal_path_is_prefix compatibility
Direct equivalent to `cmake_path(IS_PREFIX)` except for `NORMALIZE`
support.

Change-Id: Ic17990b93d458073ddc1b860a7f5d5b81bd63ea8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-02-17 16:44:30 +01:00
Alexandru Croitor
c7027880aa CMake: Provide a way to find all available Qt module packages
A project might want to find_package all available (installed) Qt CMake
packages that contain qt modules.

A use case might be a qml app that needs to link to all of Qt, and
support showing qml files that can load any Qt qml module.

Add a new Qt6 COMPONENT called ALL_QT_MODULES.

It can be used like this:
  find_package(Qt6 COMPONENTS ALL_QT_MODULES).

The implementation will find all installed Qt modules by globbing over
all json files installed in $qt/modules dir, and treat the file names
as package names.

It will then tell Qt6 to find_package each of those packages.

Pick-to: 6.8 6.9
Change-Id: I89242307438576a0cbb3cdca80a9cb72818b6035
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-27 17:36:33 +01:00
Cristian Le
334acc2eb3 Add _qt_internal_relative_path
This is a compatibility function for `cmake_path(RELATIVE_PATH)`.
For CMake<3.20 it uses `file(RELATIVE_PATH)` instead

Pick-to: 6.8 6.9
Change-Id: Ibf9ca221c1753bd99dcc1820bffaea28f9bfe5af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-23 15:25:48 +01:00
Alexey Edelev
2be02608ae Add the QT_PLUGIN_TARGETS transitive compile property
Use the freshly introduced TRANSITIVE_COMPILE_PROPERTIES functionality
to handle plugin targets across Qt modules. This will allow accessing
all Qt plugins that are required for targets at once, without the need
of iterating over the Qt targets at configure time.

This mechanism duplicates the already existing plugin collecting
routines, since we still need to support the older CMake version.

This commit only introduces the helper functions and plugins collecting,
but doesn't use the QT_PLUGIN_TARGETS anywhere.

We don't use the direct export of properties by CMake but still rely on
plugin collecting mechanism we use before to cover the situation when
Qt is built using CMake versions < 3.30 and then is used to build user
applications with CMake versions >= 3.30.

Task-number: QTBUG-129302
Change-Id: Id3b516b92e8e16552d46b2c702b76c571366f2b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-11-14 00:56:12 +01:00
Alexandru Croitor
16f49f6a1c CMake: Add IMPORTED_LINK_DEPENDENT_LIBRARIES for versionless targets
When creating non-aliased versionless targets, make sure we also add
the config-specific IMPORTED_LINK_DEPENDENT_LIBRARIES properties, so
that for older CMake versions, we still get the -rpath-link handling
of the dependent libraries.

Amends 173164cd477211e574c0d04abef51aa0f4c3f78d

Pick-to: 6.8
Task-number: QTBUG-126727
Change-Id: I22618a51bd98cc851ec1a01a27086e0b878bee8d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-07-01 21:53:19 +02:00
Alexandru Croitor
6f475a05a1 CMake: Fix _qt_internal_forward_function_args to evaluate its args
We were comparing the variable name of single and multi arg options,
rather than the value.

This accidentally worked when the variables were set, but forwarding
empty values if the variables were not set.

Explicitly evaluate the variable values to compare them against the
empty string.

Amends 96abceb64e5dc0570ca7c3419f401cfafe946ba0

Pick-to: 6.8
Change-Id: I1a701c681f5af5e665601972687024ce734aa014
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-18 10:49:21 +02:00
Alexandru Croitor
37a5e00127 CMake: Generate an SPDX v2.3 SBOM file for each built repository
This change adds a new -sbom configure option to allow generating and
installing an SPDX v2.3 SBOM file when building a qt repo.

The -sbom-dir option can be used to configure the location where
each repo sbom file will be installed.

By default it is installed into

 $prefix/$archdatadir/sbom/$sbom_lower_project_name.sdpx

which is basically ~/Qt/sbom/qtbase-6.8.0.spdx

The file is installed as part of the default installation rules, but
it can also be installed manually using the "sbom" installation
component, or "sbom_$lower_project_name" in a top-level build. For
example: cmake install . --component sbom_qtbase

CMake 3.19+ is needed to read the qt_attribution.json files for
copyrights, license info, etc. When using an older cmake version,
configuration will error out. It is possible to opt into using an
older cmake version, but the generated sbom will lack all the
attribution file information.
Using an older cmake version is untested and not officially supported.

Implementation notes.

The bulk of the implementation is split into 4 new files:

- QtPublicSbomHelpers.cmake - for Qt-specific collecting, processing
  and dispatching the generation of various pieces of the SBOM document
  e.g. a SDPX package associated with a target like Core, a SDPX
  file entry for each target binary file (per-config shared library,
  archive, executable, etc)

- QtPublicSbomGenerationHelpers.cmake - for non-Qt specific
  implementation of SPDX generation. This also has some code that was
  taken from the cmake-sbom 3rd party project, so it is dual licensed
  under the usual Qt build system BSD license, as well as the MIT
  license of the 3rd party project

- QtPublicGitHelpers.cmake - for git related features, mainly to embed
  queried hashes or tags into version strings, is dual-licensed for
  the same reasons as QtPublicSbomGenerationHelpers.cmake

- QtSbomHelpers.cmake - Qt-specific functions that just forward
  arguments to the public functions. These are meant to be used in our
  Qt CMakeLists.txt instead of the public _qt_internal_add_sbom ones
  for naming consistency. These function would mostly be used to
  annotate 3rd party libraries with sbom info and to add sbom info
  for unusual target setups (like the Bootstrap library), because most
  of the handling is already done automatically via
  qt_internal_add_module/plugin/etc.

The files are put into Public cmake files, with the future hope of
making this available to user projects in some capacity.

The distinction of Qt-specific and non-Qt specific code might blur a
bit, and thus the separation across files might not always be
consistent, but it was best effort.

The main purpose of the code is to collect various information about
targets and their relationships and generate equivalent SPDX info.

Collection is currently done for the following targets: Qt modules,
plugins, apps, tools, system libraries, bundled 3rd party libraries
and partial 3rd party sources compiled directly as part of Qt targets.

Each target has an equivalent SPDX package generated with information
like version, license, copyright, CPE (common vulnerability
identifier), files that belong to the package, and relationships on
other SPDX packages (associated cmake targets), mostly gathered from
direct linking dependencies.

Each package might also contain files, e.g. libQt6Core.so for the Core
target. Each file also has info like license id, copyrights, but also
the list of source files that were used to generate the file and a
sha1 checksum.

SPDX documents can also refer to packages in other SPDX documents, and
those are referred to via external document references. This is the
case when building qtdeclarative and we refer to Core.

For qt provided targets, we have complete information regarding
licenses, and copyrights.

For bundled 3rd party libraries, we should also have most information,
which is usually parsed from the
src/3rdparty/libfoo/qt_attribution.json files.
If there are multiple attribution files, or if the files have multiple
entries, we create a separate SBOM package for each of those entries,
because each might have a separate copyright or version, and an sbom
package can have only one version (although many copyrights).

For system libraries we usually lack the information because we don't
have attribution files for Find scripts. So the info needs to be
manually annotated via arguments to the sbom function calls, or the
FindFoo.cmake scripts expose that information in some form and we
can query it.

There are also corner cases like 3rdparty sources being directly
included in a Qt library, like the m4dc files for Gui, or PCRE2 for
Bootstrap.
Or QtWebEngine libraries (either Qt bundled or Chromium bundled or
system libraries) which get linked in by GN instead of CMake, so there
are no direct targets for them.
The information for these need to be annotated manually as well.

There is also a distinction to be made for static Qt builds (or any
static Qt library in a shared build), where the system libraries found
during the Qt build might not be the same that are linked into the
final user application or library.

The actual generation of the SBOM is done by file(GENERATE)-ing one
.cmake file for each target, file, external ref, etc, which will be
included in a top-level cmake script.

The top-level cmake script will run through each included file, to
append to a "staging" spdx file, which will then be used in a
configure_file() call to replace some final
variables, like embedding a file checksum.

There are install rules to generate a complete SBOM during
installation, and an optional 'sbom' custom target that allows
building an incomplete SBOM during the build step.

The build target is just for convenience and faster development
iteration time. It is incomplete because it is missing the installed
file SHA1 checksums and the document verification code (the sha1 of
all sha1s). We can't compute those during the build before the files
are actually installed.

A complete SBOM can only be achieved at installation time. The install
script will include all the generated helper files, but also set some
additional variables to ensure checksumming happens, and also handle
multi-config installation, among other small things.

For multi-config builds, CMake doesn't offer a way to run code after
all configs are installed, because they might not always be installed,
someone might choose to install just Release.
To handle that, we rely on ninja installing each config sequentially
(because ninja places the install rules into the 'console' pool which
runs one task at a time).
For each installed config we create a config-specific marker file.
Once all marker files are present, whichever config ends up being
installed as the last one, we run the sbom generation once, and then
delete all marker files.

There are a few internal variables that can be set during
configuration to enable various checks (and other features) on the
generated spdx files:

- QT_INTERNAL_SBOM_VERIFY
- QT_INTERNAL_SBOM_AUDIT
- QT_INTERNAL_SBOM_AUDIT_NO_ERROR
- QT_INTERNAL_SBOM_GENERATE_JSON
- QT_INTERNAL_SBOM_SHOW_TABLE
- QT_INTERNAL_SBOM_DEFAULT_CHECKS

These use 3rd party python tools, so they are not enabled by default.
If enabled, they run at installation time after the sbom is installed.
We will hopefully enable them in CI.

Overall, the code is still a bit messy in a few places, due to time
constraints, but can be improved later.

Some possible TODOs for the future:
- Do we need to handle 3rd party libs linked into a Qt static library
  in a Qt shared build, where the Qt static lib is not installed, but
  linked into a Qt shared library, somehow specially?
  We can record a package for it, but we can't
  create a spdx file record for it (and associated source
  relationships) because we don't install the file, and spdx requires
  the file to be installed and checksummed. Perhaps we can consider
  adding some free-form text snippet to the package itself?

- Do we want to add parsing of .cpp source files for Copyrights, to
  embed them into the packages? This will likely slow down
  configuration quite a bit.

- Currently sbom info attached to WrapFoo packages in one repo is
  not exported / available in other repos. E.g. If we annotate
  WrapZLIB in qtbase with CPE_VENDOR zlib, this info will not be
  available when looking up WrapZLIB in qtimageformats.
  This is because they are IMPORTED libraries, and are not
  exported. We might want to record this info in the future.

[ChangeLog][Build System] A new -sbom configure option can be used
to generate and install a SPDX SBOM (Software Bill of Materials) file
for each built Qt repository.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I9c730a6bbc47e02ce1836fccf00a14ec8eb1a5f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-13 16:54:47 +02:00
Alexandru Croitor
96abceb64e CMake: Fix forwarding the '0' argument which is by default falsey
If the forward argument was meant to be 0, it was not forwarded
because it evaluated to false in if(condition).

To pass it along, instead check for empty strings.

Pick-to: 6.8
Change-Id: Ia366df147de0c2d333017da43dc0643b56a89e9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-06-11 19:49:05 +02:00
Alexandru Croitor
358effb7a3 CMake: Add a _qt_internal_forward_function_args function
It's a helper to pass along option arguments that are set by
cmake_parse_arguments, from the current scope to another function
call.

It avoids a lot

 if(arg_FOO) set(options FOO ${arg_FOO})

boilerplate.

It is somewhat the opposite of _qt_internal_remove_args.

The options that the function takes are prefixed with FORWARD_
to avoid possible naming conflicts with the actual options that should
be forwarded.

Change-Id: I54fd22b884d8af8379f2f735eb911a3bc66d3416
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-29 23:01:47 +02:00
Alexandru Croitor
8fe9cabe16 CMake: Add functions to safely append to cmake properties
Encapsulate the boilerplate logic of querying a property and setting
it to an empty string instead of NOTFOUND, before appending a value,
removing duplicates and assigning the values back to the property.

Change-Id: I7aefd11e9bdd77090324ec50c682d62181d22076
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-29 23:01:47 +02:00
Alexandru Croitor
0e984f41e8 CMake: Move some functions into QtPublicCMakeHelpers
Move the implementations into QtPublicCMakeHelpers and just forward
to those public implementations in the old code.

The new public api will be used in the public sbom cmake files.

Change-Id: I979319935611e3f553ebd414f8304f1a3163c4ee
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-29 23:01:47 +02:00
Alexey Edelev
967732f7f7 Consider INSTALL_LIBDIR when calculating various cmake paths
Task-number: QTBUG-123039
Change-Id: I111cd612afe64a4f8456ab05d6ff3caf828c4712
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-27 10:37:16 +01:00
Alexey Edelev
e5bb392f72 Set the missing _qt_is_versionless_target property for versionless targets
Remove the versionless targets handling from pri helpers. This logic is
not relevant anymore since versionless targets hold all the related
properties now.

Amends 173164cd477211e574c0d04abef51aa0f4c3f78d

Change-Id: I933bf7409a3668333929387b8232d002ab6fa66b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-21 16:23:00 +01:00
Alexey Edelev
840f5c1760 Set the _qt_ module properties for interface targets
The module properties starting with _qt can be set on interface
targets. We should set them to handle _qt_config_module_name
property for Private targets correctly. Otherwise private imported
modules do not land in .pri files as dependencies.

Amends 173164cd477211e574c0d04abef51aa0f4c3f78d

Fixes: QTBUG-123410
Change-Id: I14866eb407e6ddcbd625f5546cba22ccc7b6a297
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-21 16:22:59 +01:00
Alexey Edelev
8db0a12e84 Collect CMAKE_MODULE_PATH from QT_ADDITIONAL_PACKAGES_PREFIX_PATH
This is sensitive for the 'include' calls that expect cmake scripts
to be found in some staging prefixes. In yocto
QT_ADDITIONAL_PACKAGES_PREFIX_PATH points to the package image
path(installation snapshot). If repo provides bundled 3rdparties
the 'include' statement that includes 'FindWrap<3rdparty>ConfigExtra'
is unnable to locate it, since it's expected to be found in Qt
installation, but the file didn't land there at ptest stage.

Fixes: QTBUG-122205
Pick-to: 6.5 6.6 6.7
Change-Id: Idd03f44efd2e3fdaa476873068c73ac28cd0a7b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-13 15:38:52 +01:00
Alexey Edelev
173164cd47 "Simplify" versionless targets
Versionless targets in Qt6 are interface libraries that link the
versioned libraries using the INTERFACE link type. This makes the
linking chain more complicated than it can be. Also we miss some
significant interface properties in the versionless targets comparing
to the versioned targets.

The new approach manually generates the versionless targets, instead
of using CMake exports.

For CMake versions < 3.18 we now create a copy of the versioned
targets. The copy includes all the relevant INTERFACE properties from
the versioned targets and imported locations for all configs.

For CMake versions >= 3.18 we now create the versionless target ALIASes
which should behave give the transparent access to the versioned
targets.

Using the QT_USE_OLD_VERSION_LESS_TARGETS flag you may force the
behavor of the CMake versions <= 3.18

The change is partial workaround for QTBUG-86533.

Task-number: QTBUG-114706
Change-Id: Iafadf6154eb4912df0697648c031fcc1cbde04e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-12 20:27:42 +01:00
Joerg Bornemann
b481393941 CMake: Add public helper _qt_internal_add_phony_target
This function can be used to create a custom target like
update_translations or all_qmllint that should be excluded from build
and be triggered by the user.

The function works around certain peculiarities of the Visual Studio
project generators that are described at length in QTBUG-115166 and
associated patches.

Follow-up patches in qttools and qtdeclarative will use this function
and remove duplicated code.

Task-number: QTBUG-115166
Task-number: QTBUG-118980
Change-Id: I87b89a658f35a5a09e3f7b04bdd5cae2166f8d62
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-12 12:38:57 +01:00
Alexey Edelev
7ac969e146 Wrap condition in _qt_internal_check_depfile_support with parentheses
The AND/OR combinations are not evaluated correctly. Wrap them with
parentheses explicitly to ensure the expected evaluation order.

Pick-to: 6.5 6.6 6.7
Change-Id: Ib2515ba85417b32cef3f799e0cb2c89d2c4257ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-22 16:08:32 +01:00
Alexandru Croitor
04a327f00a CMake: Don't recurse with qt-cmake-standalone-test in-source dirs
When the qt-cmake-standalone-test root project is configured in-source
in the source directory of a test A, where test A ends up being added
via add_subdirectory(A), this causes the SUBDIRECTORIES property of A
to contain itself for some reason.
Recursively iterating over the root project's subdirectories thus
causes an endless recursion.

Make sure to remove the currently processed directory from the
retrieved SUBDIRECTORIES property when the function is called
during qt-cmake-standalone-test configuration.

We limit it just for that script, so that we don't accidentally
increase the configure time when building all standalone tests, and
call list(REMOVE_ITEM) too many times.

Upstream issue filed at
https://gitlab.kitware.com/cmake/cmake/-/issues/25489

In a way, amends d08fa86e63448377dde4297bc94680a9d7daaaeb because it
exposed the issue.
Amends 1c82e92202c8c359872c08095670c121602094b8

Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-119998
Change-Id: I6f92a07be105cde74ac4946523967791db7bf301
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-12-14 22:59:33 +01:00
Alexey Edelev
ea3289460b Make sure that the result variable is empty in _qt_internal_collect_buildsystem_targets
Add the inside-recursion marker to the
_qt_internal_collect_buildsystem_targets function and reset
the result variable only in the top-level function call.

Amends 1c82e92202c8c359872c08095670c121602094b8

Pick-to: 6.5 6.6
Change-Id: I34b1e1edbb8a799900b95f67b80151b372073d2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-12-07 22:56:30 +01:00
Alexey Edelev
1c82e92202 Make sure we initialize moc rcc and uic for manual test targets
If manual test target is created using the standard Qt API but not
qt_internal_add_manual_test command, we need initialize autotools
for these targets. Add the generic functionality that ensures that
autotools are inialized for all manual tests.

Pick-to: 6.5 6.6
Change-Id: Ic048760390174d1be2f01096d70e84458f1c870f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-16 14:34:17 +01:00
Alexandru Croitor
828e402a19 CMake: Move __qt_internal_prefix_paths_to_roots
Move it into QtPublicCMakeHelpers.cmake so it is available also when
configuring qtbase and the Qt6Config.cmake file is not yet loaded.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I88127fe0439ae26af1d125eb584244d315574a48
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
59f0f25f71 CMake: Move __qt_internal_collect_additional_prefix_paths
Move it out of QtConfig.cmake.in into QtPublicCMakeHelpers.cmake
so that the Qt6Config file is less cluttered.

Pick-to: 6.4
Change-Id: I772a0cca35d5c03cd688c3f1de34984484444105
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Alexey Edelev
68c0e932a5 Unify DEPFILE support check
Add common function that unifies the check for the DEPFILE support.
Update the check according to the recent CMake version.

Task-number: QTBUG-99354
Change-Id: Ia2abf46fe3a9a3d17ea7a37eaf6c9c6a697c5b84
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-21 12:39:49 +01:00
Alexey Edelev
2201934efa Use 'copy' but not 'copy_if_different' on Windows platforms
Use custom script to copy big Android artifacts on Windows platforms.
The script uses 'copy' but not 'copy_if_different' when source file
size is bigger than 2GB. 'cmake -E copy_if_different' only compares
first 2GB of files because of cmake issue, so this step only
workaround the problem.

Pick-to: 6.2 6.3
Task-number: QTBUG-99491
Change-Id: Id076734700e334dfc3330da412462c2b53829b33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-10 02:31:05 +01:00