Given HEADERS = $$PUBLIC_HEADERS $$PRIVATE_HEADERS
$$PUBLIC_HEADERS can be expanded into a list of source files
which in turn contain $$PWD/foo.cpp.
The $$PWD needs to be expanded as well.
This is the case for qtwebsockets/src/websockets/websockets.pro
project.
Change-Id: I3aa14203ee8d177fadd12a7e3212c3250970e0a8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Output target was named output_target_quick instead of just output_target
Change-Id: I3ee0598bb61e654e42cb82b84da46f292d87e2cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Value was not being propagated to the parent scope when set.
This patch also changes OUTPUT_TARGET to OUTPUT_TARGETS since it is
possible that two targets can be generated.
Change-Id: If489a609ed363a319224fcd6c5a4fc878d0d8617
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
They're INTERFACE-type targets and can thus only have whitelisted
properties set. That fixes the cmake configure step for the UiPlugin
target in qttools.
This has the unfortunate side-effect that the headers will not be picked
up for our pre-compiled headers. Although it is not a big issue since we
don't have many header-only modules. An example is QtTools' UiPlugin.
Amends 2cf0ba1fba
Change-Id: If722928f64727ffaf2e9d0746668c0198fa1a647
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
We should use the new relative path to the project, instead of the old
specified on command line.
Change-Id: I54cb1cefd4df079a95c364b7c7c66c36941add01
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This makes -developer-mode build tests and examples, too.
Change-Id: I3f1a700c6e9d06ab632990561e13f059acb4e6ff
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Some modules define their own manually-maintained lists, and we can rely
on the headers generated by each module to include in the pch as well
e.g. QtCore/QtCore.
There's also e.g. QtWidgetDepends for QtWidgets, but this only
works for modules, not for tools, examples or other applications.
For now we'll use the Qt<Module>/Qt<Module> headers for the
modules we depend on.
Building with PCH can be disabled with -DBUILD_WITH_PCH=NO, and it only
works for versions of CMake newer than 3.15.20190829.
Change-Id: Iae52bd69acfdfd58f4cd20d3cfa3c7f42775f732
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To verify -DFEATURE_developer_build=ON and QT_FEATURE_private_tests
work as we expected.
Change-Id: Id428dc0da4ee441b3a1a7f433c5bc2ef066dae9e
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change-Id: Ie34c03c409a20546ace1ddc84f8813c1772936f7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If syncqt was not executed for a module, it will not have generated
headers, so we should not propagate the include/${module} header
location in that case.
Change-Id: I6dc0628a11ababb4d237215a9f4d3fc331383848
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Qt CMake Build Bot
Specifically skip cmake tests projects (because they are only needed
when Qt is built with qmake).
Also skip test qmake projects in qmake's test suite.
We might find more tests to skip in the future.
Change-Id: I4c3a42db669b31e81fd06206652371b6a70fd8ce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
If the project path starts with "examples/" relative to the repo
source directory (which is decided by location of .qmake.conf),
consider the given project file to be an example.
This makes the usage of run_pro2cmake.py easier, specifically by
being able to point it to a repo source directory, and getting most
project conversions correctly.
Change-Id: I93de98f8fc97af509c1f96cdebad3681190a53d1
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The script now detects whether the project file given is a:
- top level qmake project (qtdeclarative.pro)
- top level tests project (qtdeclarative/tests.pro)
- top level examples project (qtdeclarative/examples.pro)
This is done by finding the .qmake.conf file in parent directories of
the given project, and comparing the project's location to the
.qmake.conf location.
For the top level qmake project and the tests project, the script will
now use a predefined block of code that we usually had to copy paste and
change manually. Now only small bits will have to be adjusted manually
(project name and dependencies).
For the examples project, the content is surrounded by the required
build examples commands.
As a result, developers will have to worry less about knowing where to
copy paste from.
Change-Id: I4f751b371e74eeb86e070d58635c3d99b970ab18
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is incomplete. moc has compilation problems, some
advanced parts of qmake tests are not supported by the converter.
Change-Id: Ic389ddfa10a7558f21cf7ba9ead8e58157c760da
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As with qmake, you configure with or without -nomake tests -nomake
examples, and the choice is propagated to other repositories.
Do the same for CMake. It's still possible to opt out to build one
or the other by passing -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF
on the command line, which takes precedence over the value saved to
QtBuildInternalsExtra.
Change-Id: If0fbfa938d88309e7969c9bacc8d0bf86548bf5e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Fix the silly boolean logic error in commit
9c1b7802d7.
Change-Id: I9dd0d3e8be5cbe75583099686a623d81d3dd87fc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is similar to qmake, where the .prf files from the source
location of qtbase/mkspecs are used in a non-prefix build.
This means that if a developer changes the source QtBuild.cmake,
and then runs make in qtdeclarative, cmake will reconfigure
qtdeclarative because the timestamp of QtBuild.cmake changed.
Before this change you first had to make && make install in the
qtbase build directory, before qtdeclarative saw the modified
QtBuild.cmake.
This change also makes the module paths be prepended to
CMAKE_MODULE_PATH instead of appended, which means they will
take precedence to any path provided via command line.
Change-Id: I9178d5183a95b3b67bfe1b1fe91d3d3371ffe5c5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Don't create the plugin config files when doing shared builds, otherwise
for example Qt6GuiPlugins.cmake will try to include the xcb plugin cmake
config, which in turn will perform a full-fledged find_package series to
locate xcb. When an application just uses find_package(Qt6Gui), then
that is not needed.
Change-Id: I1890aaa5be8e214151c65fa981f547a73c0ca7fc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
QtUiTools in qttools is a public module that has only headers, so it's
an interface library in cmake. That means INTERFACE_INCLUDE_DIRECTORIES
cannot contain paths to the source or build directory, unless they are
prefixed with BUILD_INTERFACE, which this patch adds.
Change-Id: I047700f447237dfbe5a901072eb413a159ae537d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fix up the previous commit and use separate COMMAND parameters for
add_custom_command to ensure the expansion of the PATH. The injection
via -E env "/some/dir;%PATH%" does not work as the dollar expansion is
not applied when the ninja command uses cmd /C. This relies now on
undocumented behavior of cmake ;(
Change-Id: I5b5fc88e4c13f8fb6c6bba3131204c2eb35404d6
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Our tools are typically installed into the Qt bin directory, after which
they are useable right away on Windows, since the Qt dlls are located
there, too. An exception to the rule are tools that are built within a
module and used right away. At that point they are in the top-level
bin dir of the build directory, along with "local" DLLS they might need,
but with the Qt dlls out of reach. To cover this case, we need to
prepend a PATH adjusting command when using these with
add_custom_command.
Change-Id: I7f58581f5060c8004b5d1fa1f6f17297256783de
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Building qtdeclarative on Windows in a non-prefix build failed due to
usage of include paths of WinMain that don't actually exist.
Mark the library as not having include paths by setting
NO_SYNC_QT.
Change-Id: Ibdb420981069967414a119dedc7a7bfc9d61c253
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Do not build examples in static builds as they are not prepared
for this configuration.
Change-Id: Ia0fd0a6cdfa3733bf13eb2ca8398668f26c0bedf
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change-Id: I3906a08f5e0cce9abeeafbb67a83d31fbf67c703
Reviewed-by: Toni Saario <toni.saario@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In the ICC configuration we can't build the qtbase libraries with ICC
and qtdeclarative with gcc, mixing won't work well. On Windows we've
covered this compiler mixing scenario using our toolchain file, but the
ICC case makes it clear that we have to be consistent about caching the
compiler in the toolchain file across platforms.
Change-Id: Iad2005ab00655f902e5f5cea2f0563d790d8aa93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change-Id: I8cb97afaaed46ee64b5a133e797179d7ddecdeef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When building QtQmlDevTools we don't generate syncqt headers, but the
non-existent include paths were still added, which means that anything
that used QtQmlDevTools would fail to configure (the standalone tests).
Make sure to only add the include paths if syncqt was executed.
Change-Id: I6d79ecf53e9a5d396e8df801584ce2c9f119f9be
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Whenever the qml compiler is used to process qml files from a
resource, and there are no resources left after all qml files have
been processed, make sure to propagate the created resource target
to add_qt_resource, so that the target is associated properly with
an export name.
Additionally the generated qml cache loader file uses private Qml
headers. Thus the object library that contains the cpp file should
have qml as a dependency (and not the target that will link to the
object library).
Change-Id: Ib385a900823df3e015492cdd06acd8a0cb9f8e9a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The name (key in wasm.json) for the QPA plugin is "wasm", not
"webassembly".
Change-Id: I6a2568d05e4f19408fa95ac59a47acdcf90e11a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We use
qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz)
which would set harfbuzz_FOUND. Since variable names are case-sensitive,
this is also the name we must check for in the qt feature condition.
Change-Id: I43420489c3310bc9c3e5cc798a005c8d5b0ab646
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Override the default binary path for qmlimportscanner so that it points
to the host build specified via QT_HOST_PATH.
Change-Id: Ib0b47e61315c87ce6225e2d8ca84043cae03357d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update Android build configuration to be compatible with the multi-arch
android build patch to qmake. We can now build and generate the apk
correctly. Executing on the device/simulator will only work once the
latest changes from 5.14 have been merged in.
We now replace target suffix with ${CMAKE_ANDROID_ARCH_ABI}.[so|a] so
we don't have to deal with handling targets which might have any of the
OUTPUT_NAME properties set.
The dependency and deploy settings generation has also been updated to
append the file contents to a string and then do a single file write
at the end.
Change-Id: Id3c5bd0428141ecaf962124a100390e3a4e41feb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qmlplugindump is not build during a Qt static build, so there's no
point in creating custom targets that would run the tool.
Change-Id: Id7d6d44da63312f298f46eab08a5637cb0c97c8f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
At the moment we only support building with Emscripten, so that's the
system name to look for.
Change-Id: I08782ed0201da1593058bf1fb2ec61d6660802ed
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Don't try to build the ibus input context plugin when targeting
Emscripten, as there's no ibus there.
Change-Id: I949a09c4bacd3136b632e597dd8048653d0c0fea
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The first issue is that instead of arg_OUTPUT_TARGET we should use
rcc_OUTPUT_TARGET (there was also a typo in the OUTPUT word).
The second issue came with the fact that the object library targets
that were created for resources had a "Qt6::" namespace prefix in the
exported Targets files, and yet the link generator expression did not
contain the prefix. This failed when building qtsvg in a static build,
because the exported object library could not be found.
The solution is to use the TARGET_NAME generator expression which
takes care of adjusting the name of the target when exported, thus
making the linking work both when building qtbase and when building
qtsvg.
This had the fallout, that all resource object libraries need
to be associated with an export set and installed. This wasn't the case
for plugins, because plugins have an export name of the form
"FooTargets", whereas the export name for the resource object library
is "Qt6FooTargets".
Adjust the export names of plugins to be the same as for modules and
resource library objects (aka contain the "Qt6 prefix").
Change-Id: I1ca28d20c51e4447e5783cc20571a68ec77f6513
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Make sure to document both variables are required when invoking cmake.
Otherwise, one might be omitted causing side-effects.
Change-Id: I3390df1cb5352ea6113952c99fcedef5336f2fc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>