This reverts commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94.
Reason for revert: ${pcfiledir} cannot be used, because this
leads to wrong prefix values if PKG_CONFIG_SYSROOT_DIR is set.
See the comments of the associated task for instances of this
problem in other projects.
Pick-to: 6.8 6.9
Task-number: QTBUG-136210
Change-Id: I2a60946828f07866b931dacfe0ef81346f1aac9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We set the CMP0156 policy to NEW for Apple platforms for each created
Qt target, but the debug message is generic, so we should only show it
once.
Amends c20d7bcb86361d0c9f8af3807dcad9db1a3a5ca0
Pick-to: 6.8 6.9
Task-number: QTBUG-135978
Change-Id: I332bd357999647df1d5f715d154fb568911889b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Currently qmltestrunner is built as a tool, instead of an app.
That means that for most cross-compiling platforms (aside from Yocto),
the build system will look for a host binary when referring to the
qmltestrunner target. We want to look for the target platform binary
instead.
Switch the code around to prefer looking for the target platform
binary via find_program, before falling back to referring to it by
target name.
In the future when we change qmltestrunner to be an app, and also
expose its target platform binary as a target name, this should not be
needed anymore, and we could rely solely on the target name.
Amends 9edcc4690665496c2b6f15876b3979487dbad22a
Task-number: COIN-1211
Task-number: QTBUG-137005
Change-Id: If2eb93d8832a17aae3d0648d1d0f5997805796fa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If a developer configured Qt with
-DQT_GENERATE_SBOM=ON
-DQT_BUILD_TESTS=ON
-DQT_BUILD_TESTS_BY_DEFAULT=OFF
The would get the following error upon installation of qtmultimedia:
CMake Error at
qt_sbom/SPDXRef-PackagedFile-qt-plugin-MockMultimediaPlugin.cmake:5
(message):
Cannot find 'plugins/multimedia/libmockmultimediaplugin.a' to
compute its checksum.
This happens because QT_BUILD_TESTS_BY_DEFAULT == ON sets the
EXCLUDE_FROM_ALL directory property on the tests directory, which
means all plugins created under tests/ subdir are not installed by
default, and the SBOM code could not read the installed files to check
the checksums.
In such a case, set a QT_INTERNAL_TEST_TARGETS_EXCLUDE_FROM_ALL
directory-scoped variable in the tests/ subdir, and use that as a
marker for the sbom code to know it should skip the checksum check.
Pick-to: 6.8 6.9
Fixes: QTBUG-137168
Change-Id: I970c3bc5732cc648549e5099fa1d50b3b39cb26f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
...in _qt_internal_find_qt_dependencies. In the case where a package is
loaded via its own dependencies (Qt6FooPrivate -> Qt6Foo ->
Qt6FooPrivate) the inner _qt_internal_find_qt_dependencies call did
unset the backup value of QT_NO_PRIVATE_MODULE_WARNING. This could lead
to an unwanted display of the private module warning.
Treat the backup variable as a stack to deal with this situation.
Pick-to: 6.9
Change-Id: I0ee3700a040b0df8c6090470ea6fc515cb93a7d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The test and example standalone builds should not install
the wayland files.
Change-Id: If313479c8e17325cc3761fea093368f14d484d74
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
Use QT_ADDITIONAL_PACKAGES_PREFIX_PATH to look for qmltestrunner.
Needed if module install is using separate staging prefix, like is
done on Yocto builds.
Change-Id: Icfe972a7ab1d0c99518383eab1c885e490cdb4d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Backstory.
1) Starting with Qt 6.8, the prebuilt Qt for iOS SDK is built as
static framework bundles instead of static libraries. That is done so
that we can embed a privacy manifest into each framework bundle.
2) Up until CMake 3.28, CMake would not attempt to de-duplicate static
libraries (or frameworks) on the command line. Starting with CMake
3.29, the CMP0156 policy was introduced to allow such de-duplication.
3) Since a while ago, Qt had its own policy handling for CMP0156,
which it force sets to OLD, to disable any de-duplication. That was
done to avoid possible regressions on platforms where link order
matters.
4) A developer might add the -ObjC linker flag to a project, to ensure
the linker retains all Objective-C categories it encounters in all the
static libraries that were provided on the link line. Retaining in
this case means that the /whole/ object file of a static library will
be linked to the final executable.
5) The Apple ld linker (both the legacy and the new ld_prime one)
can't cope with duplicate static frameworks on the link line when the
-ObjC flag is used.
It ends up throwing duplicate symbol errors, from trying to link the
same object file from the same static framework more than once.
The linker works just fine if the link line contains duplicate static
libraries, rather than static frameworks.
6) When a project links against Qt6::Gui and Qt6::Core, the link line
will contain Qt6::Core twice. This gets even more involved, when
linking plugins, which cause static framework cycles, and thus a
framework might appear multiple times.
Thus, we have the situation that Qt forces the CMP0156 policy to OLD,
Qt6::Core appears multiple times on the link line, no de-duplication
is performed, the project adds the -ObjC flag, and the linker throws
duplicate symbol errors.
We can fix this by force setting the CMP0156 policy to NEW when
targeting Apple platforms and using CMake 3.29+.
A potential workaround for a project developer is to set the policy
to NEW manually in their project.
Unfortunately that doesn't work for older Qt versions.
That's because CMake applies the policy value when add_executable is
called, and the policy value in qt_add_executable is the one that is
recorded when the function is defined. And the recorded policy is
always OLD, because Qt6Config.cmake calls cmake_minimum_required with
VERSION up to 3.21, which resets the policy value to OLD.
So we have to force set the policy in qt_add_executable /
qt_add_library via the existing __qt_internal_set_cmp0156 function.
The __qt_internal_set_cmp0156 had some diagnostics to show a warning
when the user modifies the policy themselves, but this never worked
because of reason stated above: the policy value was always overridden
in Qt6Config.cmake.
To actually make the diagnostic work, there is now new code to save
the policy value in the current directory scope, before Qt resets
it.
This only works if a project uses the find_package(Qt6 COMPONENTS Foo)
signature. It won't work with a find_package(Qt6Core)-like signature.
The policy value is not modified for platforms other than Apple ones
for now.
Amends 9702c3c78b2c16db6a9d0515d7d7698d9b064cd8
Pick-to: 6.5 6.8 6.9
Fixes: QTBUG-135978
Change-Id: I4d6e6c2a01e7092b417fc669d2aea40cf2dca578
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The setup:
- build Qt with '-static -qt-zlib'
- configure a user project with plain cmake and -DQt6_DIR pointing to
the Qt6 package
In this case, the implicit find_dependency(BundledZlib) call will
fail with:
CMake Error at lib/cmake/Qt6/QtFindWrapHelper.cmake:120 (message):
Can't find Qt6::BundledZLIB.
Call Stack (most recent call first):
lib/cmake/Qt6/FindWrapZLIB.cmake:6 (qt_find_package_system_or_bundled)
cmake/share/cmake-3.31/Modules/CMakeFindDependencyMacro.cmake:76
(find_package)
lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)
lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:39
(_qt_internal_find_third_party_dependencies)
lib/cmake/Qt6Core/Qt6CoreConfig.cmake:42 (include)
lib/cmake/Qt6/Qt6Config.cmake:233 (find_package)
CMakeLists.txt:7 (find_package)
For example it would fail for the rasterwindow example configured with:
cmake ~/qtbase/examples/gui/rasterwindow \
-DQt6_DIR=$HOME/builds/dev-mac-static/qtbase/lib/cmake/Qt6
The failure happens because we don't pass any additional paths to the
find_package call that looks for BundledZlib, as opposed to how we do
it for module packages.
The project configuration does not fail if it is configured with any
of the following variables:
- Qt6_ROOT or
- CMAKE_PREFIX_PATH or
- the Qt generated toolchain file.
That's because these implicitly add relevant paths where to look for
Qt packages.
This came up in qtdeclarative RunCMake CI tests, where we only pass
Qt6_DIR to the test projects. It didn't come up in qtbase, because
none of the current qtbase RunCMake tests try to find Qt6Core.
To fix this particular case, conditionally pass the same paths that
Qt6Config.cmake uses when looking for module packages, to the
find_package call that looks for the bundled target.
We do it conditionally for bundled targets only, because for system
libraries we want to default looking for the module
FindWrapSystemFoo.cmake files.
Add a RunCMake test which will try to find a few Qt modules solely
based on having only Qt6_DIR set.
Pick-to: 6.8 6.9
Change-Id: I4d4e548f4c10370c4964ab8968b5772e26855dd4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The code was missing an escaped dollar sign.
Pick-to: 6.8 6.9
Task-number: QTBUG-122899
Change-Id: I51bff0a128546085e9418682b540d92eacfdbbe4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
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>
The qtwayland repository has been filtered for commits relating
to the Wayland client, via the following git-filter-repo command:
git filter-repo --paths-from-file wayland-move.txt --force --refs HEAD
And then merged into the qtbase repository via
git merge --allow-unrelated-histories
The following git-filter-repo instructions have been used:
src/CMakeLists.txt
src/CMakeLists.txt==>src/platformsupport/wayland/CMakeLists.txt
src/configure.cmake
src/configure.cmake==>src/platformsupport/wayland/configure.cmake
src/client/Qt6WaylandClientMacros.cmake
src/client/Qt6WaylandClientMacros.cmake==>src/tools/qtwaylandscanner/Qt6WaylandClientMacros.cmake
src/compositor/Qt6WaylandCompositorMacros.cmake
src/compositor/Qt6WaylandCompositorMacros.cmake==>src/tools/qtwaylandscanner/Qt6WaylandCompositorMacros.cmake
src/3rdparty/
src/3rdparty/patches/==>src/3rdparty/wayland/patches/
src/3rdparty/protocol/ivi/REUSE.toml==>
src/3rdparty/protocol/ivi/ivi-application.xml==>
src/3rdparty/protocol/ivi/ivi-controller.xml==>
src/3rdparty/protocol/ivi/qt_attribution.json==>
src/3rdparty/protocol/
src/3rdparty/protocol/==>src/3rdparty/wayland/protocols/
src/extensions/qt-shell-unstable-v1.xml==>
src/extensions/
src/extensions/==>src/3rdparty/wayland/extensions/
src/client/
src/client/==>src/plugins/platforms/wayland/
src/global/
src/global/==>src/plugins/platforms/wayland/globalprivate/
src/shared/
src/shared/==>src/plugins/platforms/wayland/shared/
src/plugins/decorations/adwaita/==>
src/plugins/decorations/
src/plugins/decorations/==>src/plugins/platforms/wayland/plugins/decorations/
src/plugins/hardwareintegration/client/
src/plugins/hardwareintegration/client/==>src/plugins/platforms/wayland/plugins/hardwareintegration/
src/plugins/platform/
src/plugins/platform/==>src/plugins/platforms/wayland/plugins/platform/
src/plugins/shellintegration/qt-shell/==>
src/plugins/shellintegration/ivi-shell/==>
src/plugins/shellintegration/
src/plugins/shellintegration/==>src/plugins/platforms/wayland/plugins/shellintegration/
src/plugins/CMakeLists.txt
src/plugins/CMakeLists.txt==>src/plugins/platforms/wayland/plugins/CMakeLists.txt
src/qtwaylandscanner/
src/qtwaylandscanner/==>src/tools/qtwaylandscanner/
tests/auto/client/iviapplication/CMakeLists.txt==>
tests/auto/client/iviapplication/tst_iviapplication.cpp==>
tests/auto/client/shared/iviapplication.h==>
tests/auto/client/shared/iviapplication.cpp==>
tests/auto/client/
tests/auto/client/==>tests/auto/wayland/
tests/auto/cmake/test_waylandclient/
tests/auto/cmake/test_waylandclient/==>tests/auto/cmake/test_waylandclient/
Done-with: Alexandru Croitor <alexandru.croitor@qt.io>
Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Task-number: QTBUG-133223
Change-Id: I46c325724141fdbfcc117d12fb5f92852613e72a
For Wayland protocols, "/usr/share/wayland-protocols/" is used on
Ubuntu/Debian derived, and same for arch. The share directory is
different with data and archdata directories.
Change-Id: I3bdd5bdc60bd4f66de66aecc943893978c86f19b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Don't write an absolute prefix into generated .pc files but one that's
relative to ${pcfiledir}. This makes the files relocatable, and we don't
have to patch them in the Qt online installer.
Pick-to: 6.8 6.9
Fixes: QTBUG-136210
Change-Id: I5c2f9398917be03f6c63286e553c87ff52971285
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
As qmltestrunner is not any longer qt tool.
Adjust the executable name and add the way to find
it outside the qtdeclarative.
Reflects the change in:
https://codereview.qt-project.org/c/qt/qtdeclarative/+/642618
Task-number: COIN-1211
Change-Id: I628de79f09cc27fb4d4fc43f297fcfb0c808ee19
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
CMake MR #10626 doesn't consider the MSVC compiler as valid assembler
anymore, thus unconditionally requiring ASM breaks with CMake > 4.0.1 on
MSVC.
Enable ASM only on non-Android Unix.
Remove the ASM language where it's not needed.
Pick-to: 6.5 6.8 6.9
Change-Id: I5df71edfce0f4920e39262f722e4bf95a735f31b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Currently, configure fails late with
Qt requires at least version 15 of Xcode, you're building against
version . Please upgrade.
Pick-to: 6.9
Change-Id: Ic4f44d37429ac9def785a50909a25b0bcb4b72a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If one of the interface link libraries of a target is
"$<LINK_ONLY:$<BUILD_LOCAL_INTERFACE:Foo>>"
this will be exported by cmake as
"$<LINK_ONLY:>"
in the exported INTERFACE_LINK_LIBRARIES property.
When walking the dependent libraries of a target using
__qt_internal_walk_libs(), this value will become empty after
unwrapping the LINK_ONLY genex.
In such a case, we should skip further processing of the library.
Otherwise in some weird unknown conditions, CMake might consider the
empty name to be a valid target, and cause errors when trying to read
properties from it.
Amends ad7b94e163ac5c3959a7e38d7f48536be288a187
Pick-to: 6.9
Fixes: QTBUG-136039
Change-Id: I143dec697e10530379486462697cd299940ee463
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This would allow us using Photos.framework/PHAssets on iOS (instead
of now-deprecated 'Assets' library).
Change-Id: I922e4765e8fdadf872f801b55a1e4ef4368e65b0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
We should only pass PROJECT_COMMENT if it has a value.
We also need to escape semicolons, because the project comment might
contain the qt configure line, and that might have passed arguments
like -qpa offscreen\;xcb
Pick-to: 6.8 6.9
Change-Id: I934cf75c376b3466ba91a433d009e6eaa77a60fa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
When processing multiple attribution files to collect all attribution
ids, the values of the previous iteration extracted keys were not
reset.
This caused the values to leak to the next processed attribution id
target if the specific id key was empty.
Make sure to clean up the values before parsing the next attribution
key.
Pick-to: 6.8 6.9
Change-Id: I386fc9c09276c49207382b06605efeb0d939b6da
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
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>
Starting with CMake 4.0, CMake doesn't initialize the
CMAKE_OSX_SYSROOT variable with any value when running on a macOS
host and no explicit CMAKE_OSX_SYSROOT or CMAKE_SYSTEM_NAME is set.
CMake expects the platform compiler wrapper /usr/bin/c++ to pass an
appropriate -isysroot flag to the underlying compiler, without CMake
explicitly setting one.
This mostly works, but the configure output will not show anymore the
active sysroot path.
Query the active path from xcrun, and display it in the configure
output.
Pick-to: 6.8 6.9
Task-number: QTBUG-135621
Change-Id: Ic9b9a43e25bb88bb83165dce52356c77ea8fffe1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Introduce two new functions _qt_internal_get_apple_xcrun_output
and _qt_internal_get_apple_sdk_name, to allow reusing them in the
future.
Make sure to set the output variables to empty even
outside Apple platforms.
Show an error when xcrun is called when targeting a non-Apple
platform.
Pick-to: 6.8 6.9
Change-Id: Ic3895f74cfcac337bff069f8e6ec1517aec6c8d0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
[ChangeLog][CMake] qt6_import_plugins doesn't have any effect anymore on
plugin deployment with the CMake deployment API on Linux.
[ChangeLog][CMake] qt6_deploy_runtime_dependencies now supports the
following plugin selection flags on Linux: INCLUDE_PLUGINS,
INCLUDE_PLUGIN_TYPES, EXCLUDE_PLUGINS, EXCLUDE_PLUGIN_TYPES.
Before this patch, we were deploying the plugins of every Qt module we
discovered when walking the dependencies of the target to be deployed.
That doesn't work if the target links against a shared library that
privately links against another Qt module, i.e. QtMultimedia like in the
bug report.
We need to take into account the Qt modules that are discovered when
retrieving the runtime dependencies at deployment time and deploy their
plugins.
Also, we now run file(GET_RUNTIME_DEPENDENCIES) and plugin discovery in
multiple passes. Every pass might discover new Qt plugins whose runtime
dependencies must be resolved. We stop if a pass did not discover new
plugins or after a certain number of passes.
Plugin discovery works like this:
- identify the Qt modules within resolved libraries,
- read the plugin types for the module from the corresponding,
module JSON file in Qt's installation,
- glob the files in Qt's plugins directory,
- select the files according to the plugin types from the Qt modules
and the INCLUDE.../EXCLUDE... arguments passed by the user.
We also read the default QPA platforms from modules/Gui.json and deploy
those.
Fixes: QTBUG-117731
Change-Id: I62ec96ab6de8327941c4c5a0ba83fd89f1733768
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Large graphical Qt applications heavily rely on heap allocations.
Jemalloc is a general-purpose malloc(3) implementation designed to
reduce heap fragmentation and improve scalability. It also provides
extensive tuning options.
Add a -jemalloc configure option, disabled by default. When enabled, Qt
and user code link to jemalloc, overriding the system's default
malloc().
Add cooperation with jemalloc for some Qt key classes: QArrayData (used
by QByteArray, QString and QList<T>), QBindingStoragePrivate,
QDataBuffer (used by the Qt Quick renderer), QDistanceFieldData,
QImageData, QObjectPrivate::TaggedSignalVector, QVarLengthArray.
This cooperation relies on two jemalloc-specific optimizations:
1. Efficient allocation via fittedMalloc():
Determine the actual allocation size using nallocx(), then adjust the
container’s capacity to match. This minimizes future reallocations.
Note: we round allocSize to a multiple of sizeof(T) to ensure that
we can later recompute the exact allocation size during deallocation.
2. Optimized deallocation via sizedFree():
Use sdallocx(), which is faster than free when the allocation size
is known, as it avoids internal size lookups.
Adapt the QVarLengthArray auto tests on capacity.
Non-standard functions docs are at https://jemalloc.net/jemalloc.3.html
[ChangeLog][QtCore] Added optional support for the jemalloc allocator,
and optimized memory allocations and deallocations in core Qt classes to
cooperate with it.
Change-Id: I6166e64e66876dee22662d3f3ea3e42a6647cfeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The ccache man page says we have to compile with -fno-pch-timestamp when
using clang and precompiled headers.
"Professional CMake" also recommends this approach, and the ccache
statistics report a marginally better hit rate with this patch.
Task-number: QTBUG-131650
Change-Id: Ic1c17a3977771673ac256674143dbdf8d5ffa28c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Initialize the variable with the default value, to avoid the type
mismatch warnings.
Fixes: QTBUG-135648
Pick-to: 6.8 6.9
Change-Id: I3ae2c59fb42676b373bcbbe06d3e6636203e283b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
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>
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>
The user may set different global defaults for CMAKE_MACOSX_BUNDLE
and CMAKE_WIN32_EXECUTABLE, so we shouldn't unconditionally override
them on a target level.
This allows cmake ~/foo/ -DCMAKE_MACOSX_BUNDLE=ON to build a project
as a GUI app without needing to modify the CMakeLists.txt with target
specific overrides.
Change-Id: Id49adb1c0aedfe82a2b1d919d086c5112ba92b93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The xcrun binary may be installed in a different location when cross
compiling to macOS using osxcross.
Change-Id: I47398e8da19c42e5e9d1b595673048c56662ea2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If we build the specific module against installed Qt syncqt cannot
detect the installed module headers, since it only checks the build
paths. This adds the installIncludeDir argument for syncqt so it
now attempts looking for the included header file in Qt install path.
This will raise early warnings in Qt per-module builds too, but not
only when building top-level Qt or for non-prefixed builds.
Pick-to: 6.5 6.8 6.9
Change-Id: I5a28ec35a776b5b39f4a8923c9bf91e857f45e4a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Amends 87965f05567d1d65af705fd61b68a02710a4fa52 by adding a comment to
the qdoc invocation that generates the documentation.
Change-Id: I7e3e0a1386d54da0fb35b1853a6032dd2949da16
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use the original functionality as the fall back solution for
the introduced by CMake 'file(CONFIGURE' command.
Pick-to: 6.8 6.9
Change-Id: I2be7e3bf80a577cdf8292c9f47bb127fa71615b6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Swap the argument order so the "output" is the first argument.
Pick-to: 6.5 6.8 6.9
Change-Id: I1325af97f1d6540c6897b51f1b5736b4534f6412
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Adjust the function name according to our naming convention for
private function locating in public cmake scripts.
Pick-to: 6.5 6.8 6.9
Change-Id: I3a108cdb43bd4b3d8cf29ac4c42c7c20c541afc8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Older CMakes error out with
CMake Error at cmake/QtSyncQtHelpers.cmake:156 (list):
list sub-command REMOVE_ITEM requires two or more arguments.
if the last expanded variable is empty.
Fix by doing an explicit non-emptiness check.
Amends e7834e90f38891382f830da7700f00ebd81f21a8
Pick-to: 6.8 6.9
Task-number: QTBUG-134672
Task-number: QTBUG-128730
Change-Id: I3c355a02519c2c450235770b2ff8c92416615a9f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Manage the HostInfo variable prefix the correct way. The prefix
takes the HostInfo PROJECT_VERSION_MAJOR as the version specifier,
which is not necessary is the same as the PROJECT_VERSION_MAJOR
of the project that uses respective API. Instead of relying on the
current PROJECT_VERSION, use the version info stored in HostInfo
package and adjust the prefix accordingly. This will allow version
mismatching between the project that uses API and HostInfo version.
Change-Id: Idbaec1c7bb203448ceb0f15c9173ad3985c7112d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Generate and install the HostInfoConfigVersion file for the
HostInfo package. The package had no strict version compatibility
as Qt modules before, so we avoid adding them here too.
Pick-to: 6.5 6.8 6.9
Change-Id: Iaee43639dd87d911946c8ce72c4849f43599d08e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The related functionality meant to be enabled by BuildInternals, which
makes the lookup of the pre-defined HostInfo version based on either
calculated or pre-defined INSTALL_CMAKE_NAMESPACE.
The PROJECT_VESION(_MAJOR) meanwhile is hardcoded by the current Qt
repo, which is not necessary aligned with BuildInternals/HostInfo.
Pick-to: 6.5 6.8 6.9
Change-Id: I61052c93ce2d6ee3c6d8025da2e078edcde48d0d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Avoid hardcoding the HostInfo package version, use the
INSTALL_CMAKE_NAMESPACE as the reference for the find_package calls.
If we assume that the package follows the versioning in the future,
we should consider the Qt version, to avoid any version related
issues.
Pick-to: 6.5 6.8 6.9
Change-Id: If84550ab82f8de51ff5af41c7f31838c4ed53a67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before this change, if someone called ninja Gui_generate_docs, it
would implicitly depend on sync_all_public_headers -> Gui_sync_headers
which would generate dbus headers.
This caused trouble with the new 'build doc tools from
qttools/dev/HEAD' approach, because an older pre-built dbus tool might
be passed a newer option when integrating a qtbase change that passes
the new option.
To avoid that, we now filter out the dbus headers from the list of
headers that should be processed by syncqt when building a
documentation target.
We do the same for the qvkgen generated headers.
This also removes the dependency on the ${target}_sync_headers target,
which means there is a potential issue when someone manually calls
`ninja sync_all_public_headers Gui_sync_headers` or something like it,
which would spawn two syncqt processes that access the same files
concurrently. This is an edge case that should not happen, but if it
ends up happening, we will have to implement some kind of lock file
mechanism.
Pick-to: 6.8 6.9
Fixes: QTBUG-134672
Task-number: QTBUG-128730
Change-Id: I9061f9495e2faa77744f5f5c0de8fedd362ba228
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>