At least on Ubuntu the name of the pkg config package
is libsystemd and not systemd.
This fixes libsystemd showing up as not found in the feature
summary.
Change-Id: I099a253026ca8096b9e2f348a5f35209d44acc6c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Qt CMake Build Bot
If the target exists or the find_package() call succeeds
we still need to set _FOUND to 1.
Change-Id: Ib2267c30580082dcc177ab21708a3bc5dbde974f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Qt CMake Build Bot
qt_find_package usually does 2 find_package() calls, one in CONFIG
mode and one in MODULE mode.
If the CONFIG mode doesn't find a Config file, the package_DIR cache
variable is set to NOTFOUND, and this causes the FeatureSummary
at the end to show that the package was not found, even if it is
found by the next MODULE mode find_package call.
Make sure to unset the _DIR variable in case if the Config module
call fails.
This fixes XRender showing up as not found even when it's found via
the FindXRender.cmake file.
Change-Id: I6ce39dad9cbb11836ca71f735a3267070c75b444
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Qt CMake Build Bot
Add custom code to handle WINDOWS_SDK_VERSION comparisons,
similar to how it was done for QT_GCC_MAJOR_VERSION.
Also fix simplify_condition to do mapping of conditions to unified
tokens, similar how it was done for target conditions, so that the
simplification process does not fail because of whitespace.
Change-Id: Ia0cec6e1ffeed4c7859bb2a44423d0160222f425
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We can't really handle this in a generic way now, because the values
of CONFIG() can not be directly mapped to features. It might be
possible in the future if we make sure that all configure.json entries
that have output publicConfig or privateConfig also generate a
feature. For now just hardcode the case.
Change-Id: Ie6b82b87973deb84012c3620b41920b343ffb2da
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There was a missing f prefix for the f-string, and thus no
replacements were done.
Change-Id: If778d4ce25905c302de22a76c27af00a63f3c515
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is needed because the ported over requires() clauses from qmake
to CMake are executed before qt_repo_build(), which means that all the
custom platform variables that we set (like LINUX, APPLE_OSX) need
to be available immediately after finding BuildInternals.
Change-Id: I7345b69edf72c266508846766e64f42c99862d1d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Allow setting feature defines to ON, YES, TRUE, Y, OFF, NO, FALSE, N and
non-negative numbers like it's possible for other defines.
We'll not allow IGNORE and NOTFOUND, because they're a bit strange in
the context of features.
Change-Id: I7f6cd6dff4c68972921b499b28916c9ad789d510
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
The set command looked like this:
set \"PATH=...\"
which was setting the environment variable \"PATH.
Removing the escaped double quotes makes it actually work.
Change-Id: I2c1d5d01b4415220512b005b75b7b67c695e33ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
I haven't checked if the config for wayland-kms actually works, as that
requires building for a target that supports it (RCar M3 or similar).
Task-number: QTBUG-78177
Change-Id: Ib30a63a4e5feb955d17763c37e32ad3f2c13d358
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There's no library to link against and the headers are in the system, so
we can create a synthetic import library after verifying the
compilation.
Change-Id: I9baa32cfe06f2f48adf066d558aa69646143efd0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Do not stop the whole conversion if we encounter $$files(..., true).
Ignore the 2nd parameter for now.
Change-Id: If9334ce9719b98c33716dc7f18ba8aede05fe8b1
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Note that from a quick grep, nothing sets QT_COORD_TYPE in the CMake buildsystem yet,
and nothing uses it either.
Change-Id: I91241089ff08f6b93d1d0b00e135063cfe516dfc
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since the direct .moc inclusion was added for cmake, we need to make the
_p.h visible to qmake via HEADERS so that qmake can also see this.
Change-Id: I042544856fe28e46b978d3b5938fbff8614367be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
If the qml files are not listed in the qmldir file they do not need
to be written again, since it is expected that they are registered
by the c++ plugin code.
Change-Id: I624aedb182583f942bf1d1a322861c47a64b5065
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
On macOS the config.tests executable should not be a bundle,
and on Windows it should be a subsystem console application.
Change-Id: I2c8078cc9537df42683f3ff3bcce409402824555
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
As well as SIMD tests.
Change-Id: I43318418f90a6b9736eb89f008459c7d6adac8f9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It makes too much noise when configuring.
Change-Id: I0a65cb99d0dc9a6c0d288cf548035cca1bea57bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Fixes were upstreamed with commit
3b0bf71a72789eb2b79310b4f67602115e347f56 in extra-cmake-modules and this
brings the file in sync.
Change-Id: Ica3a29fd091afa669f29a3e9775e637566f1cb97
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
WAYLANDCLIENTSOURCES and WAYLANDSERVERSOURCES is used heavily throughout
QtWayland.
Task-number: QTBUG-78177
Change-Id: I4507447054c435f78e82c2ca3e9404288db6c1f6
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There is an issue about versionless tool target not finding
the regular targets, and that fails the configuration phase
of qtdeclarative.
Temporarily don't export the versionless targets, to get the
qt5 build going.
Change-Id: I5c7baff7f677f4a3f1f91b9e8082ba8a80f9cddd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The separation of functionality into functions in commit
37756ede09 accidentally broke top-level
builds as the function to detect -top-level was operating on local
parameters (shift) or they were not available ($1). Inlining these few
lines fixes it.
Change-Id: Icf609dc5e7b361997847f3ef3a1b10635c122d5d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This is useful for providing private CMake API which is not part of
QtBase. Also, fix the setup files to be included when building
standalone tests. The old ${PROJECT_NAME}Setup.cmake file inclusion will
be removed once all usages are adjusted.
Prompted-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change-Id: I5bc2bca7371660c00b0301e94d025a29b68d6975
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change the grammar to parse and extract the whole expression
that is present in the requires clause.
Make sure to preprocess the parsed content as a condition,
so that the value passed to map_condition and simplify_condition
is valid and the functions can handle more complicated conditions
like qtConfig() and if().
Wrap the final condition with an extra pair of parentheses, so that
the negated condition is computed correctly.
Handle the require clause in subdir projects, top level tests projects,
regular test projects, as well as top level repo projects.
Examples are not yet handled, because the would require some kind of
CMake public api to e.g. query if a feature is enabled.
Change-Id: I9af96cf022e47b66f24db3ca15d3803dda7a5d7c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The qmake syntax for env var expansion is "$$()".
The parantheses are not optional, so the optional "?"
modifiers should be removed.
This fixes the failing test_recursive_expansion pytest.
Amends c58df80cf7.
Change-Id: I5d7217555287ee7d96d6b38027964b1141af208a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Previously we used a regular expression that matched parentheses,
but the regexp didn't match the parantheses in a balanced way
if there was more than one pair.
Instead use a helper function that uses pyparsing to match
balanced parantheses, and removes the if keyword, leaving
just the nested expression.
Change-Id: Ie621e6a305e57aa411838288599366ccfba063cc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Sympy uses eval() inside its code, and that can raise an
AttributeError exception, so we have to catch that.
This happened when converting qml.pro in qtdeclarative.
Also the formatting change removed the raising of an exception
when an unhandled function was encountered in handle_function_value,
which caused not returning any value in such a case.
Instead just return the whole expression string, without checking
if the function is in some whitelist.
Also encountered in qml.pro.
Amends 91634c3c9b.
Change-Id: I47b73af1de0180becb9ef4fb78a8c35a04928d34
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Previously you had to make sure to use DISABLE_TOOLS_EXPORT
in an add_qt_module call if the tools are built after the module,
as well as to manually call qt_export_tools after all associated
tools are built.
This was needlessly complex, especially for people that are porting
a repo with tools for the first time.
The tools package creation is now automatically done at QtPostProcess
step, so there is no need to use either DISABLE_TOOLS_EXPORT or
qt_export_tools() manually.
DISABLE_TOOLS_EXPORT is now a no-op, and will be removed once all repos
are updated not to use it.
Change-Id: I965b0d3a8a0cb908afae87b047083ed7bea9f02f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Handle conversion of config.tests that are used as out-of-line tests
in configure.json.
The script should able to handle conversion of simple config tests
including nested scopes.
One thing that will probably be needed in the future is handling of
pkconfig which is used in qtwebengine config.tests.
There is also a hardcoded list of config tests which should not be
automatically converted by pro2cmake, either because they were hand
written, or because it doesn't make sense to convert them for now.
Incidentally, we should fix example conversion to also handle nested
scopes, similarly to how it's done for config.tests.
Change-Id: I862e67c4d19d5ed8cb7fc7c9f9aaf6e3d503aa03
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Generate appropriate qt_config_compile_test() calls for config tests
that have CMake projects. These are protected by an if(EXISTS) check
so that configuration doesn't fail for repos where the config tests
have not been ported yet.
Adjust the qt_config_compile_test() function to use try_compile for
projects specified via new PROJECT_PATH argument.
Change-Id: I83c061e384f68688a654b782fd7a9bede282d1e3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Second and final batch of changes related to string
formatting styling.
Change-Id: Ifc0e999ee95fe52fd076ac2f001b4a58f82ab5be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To build examples as part of a non-installed Qt prefix build,
not-yet-installed Config files need to be found by find_package()
calls inside example projects.
Facilitate that by propagating the CMAKE_PREFIX_PATH and
QT_EXAMPLES_CMAKE_PREFIX_PATH paths in all relevant find_package()
calls where NO_DEFAULT_PATH is used.
Also adjust the inclusion of the QtFeature.cmake file to be relative
to the qt6 directory, rather than the current list directory.
This is needed to successfully find the file when parsing a Config
file from a non-installed build directory.
Change-Id: I36031279628f1f7741d8f4d7571484a6545227f7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
For example qtserialport has
requires(!winrt)
and with this patch it gets translated to
project(...)
if(WINRT)
return()
endif()
find_package(...)
qt_build_repo(...)
Change-Id: Ic38b803b464037a42adc55930947f57c5efa7b45
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
EMSCRIPTEN is the name in cmake land as per emscripten's toolchain
file.
Change-Id: I11fa444204003f25f14fbf993ecf6766bf37d884
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>