Otherwise we get errors like the following in non-gui projects:
Error evaluating generator expression:
$<TARGET_FILE:Qt6::uic>
No target "Qt6::uic"
Change-Id: I8a3a6f8ec5e5c1c3d1f73369c5739a321c64bfbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qt6_add_resources already supported the OPTIONS multi value parameter,
but only for the non-target case. Use the same parameter for the target
case.
Change-Id: Ib5fcb976ecbac244c3b11073b3cdd0c5c6366a87
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Do not mis-report "PLUGIN_TYPE", "PLUGIN_CLASS_NAME", "CLASS_NAME"
and "MODULE_PLUGIN_TYPES" as ignored.
The script evaluates these.
Change-Id: I26546a7eff61a20afe68168a865fe3ac99f66319
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Extend globbing support in resource in order to be able to handle
globbing expression present in qmake expression such as
RESOURCE.files = *.qml
Change-Id: I55a38c0bdc231a6a1ddbd65be7f57ca6f7dc2932
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
In some cases after cleaning and simplifying the conditions
you can end up with the following line:
((()))
Python interprets that as an empty tuple:
>>> a = ((()))
>>> a
()
and then the simplify_condition (sympy) method fails to continue
with an error:
File ".../util/cmake/pro2cmake.py", line 1993, in simplify_condition
condition_expr = simplify_logic(condition)
File ".../sympy/logic/boolalg.py", line 2292, in simplify_logic
expr = expr.xreplace(dict(zip(variables, s)))
AttributeError: 'tuple' object has no attribute 'xreplace'
You can see this behavior with the file:
qtmultimedia/tests/auto/unit/multimediaqml.pro
Change-Id: Ied4285b67f1e567660be49f6610311199bc48a22
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
This clarifies the weird pause when configuring, right after
the HAVE_reduce_relocations test.
Change-Id: I0edcbbd085286c20c4eaea8d8e15a509ec93d85f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some tests are changing headers using defines inside the tests.
Let's more closely mirror what qmake does to fix this. And it will also
save quite a lot of space since most tests don't include all of
e.g. QtCore
Change-Id: I6f7e530f922418944d690bd2a1ee5f459ba755e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
...which is needed, because pro2cmake thinks everything is a Gui project.
Change-Id: Ib68f3eb0e796365e03b3805a3f742824cc263157
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Store generated qrc, cpp and qmlcachegen file from invocations of
add_qt_resource/qt6_add_resources/qt6_process_resources under .rcc
in the target's binary directory.
Change-Id: I844f97acfabe6b54db85e7a7a0c9c25694452bd3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
There are some libraries inside examples that cannot be
properly translated due to the fact that the is_example
variable is True.
This condition excludes it, for example:
qtmultimedia/examples/multimedia/spectrum/3rdparty/fftreal/
Change-Id: I68a1e7d1684ab4604f54b6d16bf88d04e3214ba9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extend the example writing section to handle qml plugins. Detection
is based on whether the plugin config is detected an the target links
against Qml.
add_qt_qml_module() now uses the the public facing API underneath.
Change-Id: I2ccd06548e7b5b18c9dc3338b835bc115fa97809
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Use lower case for the function name as that's cmake style.
Change-Id: I6c53166aa3a8cece4abe8a485e06bd359fc12a06
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Brown paper bag for me, don't use a comma to separate parameters when
calling a function.
Change-Id: I21e16142fab4fd1c2714df13cd6a892b036e899a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In an extreme case where /bin/syncqt.pl does exists,
is better to check if the QtBase_SOURCE_DIR is not empty
to avoid a mismatch script version that is being used.
Change-Id: Ia5694eadc5517998b827eccf70bdf6f3c14ebfa3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Incorrect variable name was being used to set the target in the parent
scope.
Change-Id: I73ea644ebf94c9b9a62b34b1ad493e488729ff2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Replace things like $$(FOO) to $ENV{FOO}.
This is needed to stop the script from crashing when it sees $$(FOO)
in a .pro file, like in
qtmultimedia/src/plugins/directshow/directshow.pro
A better approach in the future will be to write a Find module that
uses the env var to find the relevant headers, and then instead use a
CMake cache variable, to make the build more robust in case the env
var is removed after first configuring the project.
Change-Id: Ia5b3dc3a90e1d4159a8b90acdade85f34b5165f9
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
The option --only-missing was added to check only the
cases where there is a pro file and not a CMakeLists.txt
Change-Id: Ifc6233552757e0afe8e7242a79f958e8bc77f823
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
flake8 was used to evaluate the file, with a couple of exeptions:
E501,E266,W503
black was used to reformat the code automatically
The changes were:
* Added a README that explains how to use pipenv and pip,
* Remove unnecessary return statements,
* Remove '\' from the end of the lines,
* Use f-strings (>= 3.6) since we are requiring Python 3.7,
* Commenting unused variables,
* Adding assert when Python >= 3.7 is not being used,
* Wrapping long lines to 100 (Qt Style),
* Re-factoring some lines,
* Re-ordering imports,
* Naming `except` for sympy (SympifyError, TypeError)
Change-Id: Ie05f754e7d8ee4bf427117c58e0eb1b903202933
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In qmake land, testlib.pro has "console" in MODULE_CONFIG, so linking
against testlib implicies CONFIG += console. The need for a console app
is typically also covered by other cases, except in qtdeclarative's
qqmldebugjsserver binary (and some others). They are not test helper
binaries, they are not Qt tests themselves, but they must be console
apps and due to their QT += testlib in the .pro they become console
apps. So with cmake they also must be console apps so that the unit
tests that launch them and read their stdout can pass.
Change-Id: I687fdc910b550051750be74ecd176dd96626675c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This fixes the calls to add_qt_docs to include the target.
Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In the future need will need to continue to tie qdoc runs still to
targets, just like with qmake. This change prepares us for that by
ensuring that add_docs takes two parameters and that any re-generated
CMakeLists.txt from now on gets it right.
Change-Id: Id0256dc1e2f2f59f3b4e4ca98f0d10d025d189fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is similar to how we show the instructions when configuring
in qmake land.
Change-Id: Iabd28acc3d74fd0175eab812a412744dac89e6f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
By adding the path to the DLLs early on in the path. This fixes the
issue seen in CI (0xc0000135, DLL not found) and resolves local issues
where you might have forgotten to add this to path yourself potentially
grabbing libraries from elsewhere.
The ${path} seems to be a holdover that is no longer used, so it was
removed while the code was changed anyway.
Also disable WIN32_EXECUTABLE for all tests so that we can actually get
some output from them :)
Change-Id: Iec42c809c37be4f31c7f0a7af3a30c3528022dbe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Needed to successfully parse qtconnectivity projects
where there are expressions like:
WINDOWS_SDK_VERSION =
$$member($$list($$split(WINDOWS_SDK_VERSION_STRING, .)), 2)
Also fix '$$member' to be handled in the function.
Change-Id: I35b5cff8c39b3a35d485d1d72f5d668cccbe9b2f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Prefix by python executable and drop os.nice.
Change-Id: Idd1d0de6695887652db84261da1130a084e5af78
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Change-Id: I8113d7dd4e7967d020d59a5b4104e8366d55283c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Almost every non-trivial .pro file has line continuations.
Remove the warning as there's nothing the user can do about it.
Change-Id: Ic8a54e5e5cc39a31267800edde4b0ff2b0276a48
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Needed for qtcoap, otherwise AUTOMOC doesn't run moc
on qcoapnamespace.h.
Change-Id: I4ca43fcbbc5db6163f9f9f788b920eae86f5b174
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In qmake, the header files used for private symbol versioning is done
via
private_api_headers = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.QPA_HEADER_FILES
So we must do the same with CMake.
Change-Id: Iaebeb13592241b6c4d89f70d2e6ac3ebfb374207
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
BUILD_EXAMPLES and BUILD_TESTING are supposed to be defined via arguments
when executing cmake. The current text does not make that clear. Change
the wording, so that it matches other places in the document that explain
which cmake arguments to set when.
Change-Id: I058cf9d6bc7660c9f4820e2a7342bc64e99d6a72
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The if around the find logic meant that the module was never shown as
found after the first round.
Change-Id: I3dd47b37baf7c630c54adbce6872b99f9ff56ad0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>