The ParseResults may be a nested list of list. Now the code doesn't
raise exceptions, but it fails in do_include as includes that doesn't
provide resolved path will fail. Anyway step in the right direction.
Change-Id: Ice44e4c10d221293cc6c1facca30abd5495791be
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
One directory may contain many pro files. The generator was happily
generating the same CMakeLists.txt for all of them (overwriting).
This patch implements a different logic. It tries to find the main
pro file and skips others assuming that somehow implicitly they will
be incorporated (for example through SUBDIRS).
Change-Id: Ie07d75e900a96dd48bf981a896c9dfb920f39a23
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
We do not need to validate everything, while converting project
files. Some checks can be left to building step.
It fixes some false positive NOTFOUND errors.
Change-Id: I81ff2421fdea13add0bfc03086152a47bce39908
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
It is regression caused by a0a94576fa
("Fix RemoveOperation").
Add unit test for all operation types to make sure this code actually
works:-)
Change-Id: I97c94cb3411f05de89422e3fa2222f2217a09e49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The install path takes into account the path structure of the source
directory, so that not all tests are bunched up into /tests, but
rather /tests/auto/foo/bar.
Change-Id: I5e32d2e41ae8f095f4eac6654973508efd598df0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Only require TYPE if no OUTPUT_DIRECTORY, ARCHIVE_INSTALL_DIRECTORY
and INSTALL_DIRECTORY is provided.
Change-Id: I6db1cfaa576bfa3ee3dc8ecf81db20e3afcd61e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The operation was using an empty set as a base, so it was not really
functional.
Change-Id: I98fd80c1ede31994857aa1f0c8947ca7b9f76649
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
We can use all cores. Sadly it doesn't balance cores well as
corelib.pro takes most of the time anyway, but the speedup is
visible from ~15 to 5 min.
Change-Id: Id8209c58491b38d19c6e9f1163d366c3e33a182c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
While building on macOS, AUTOMOC sometimes hanged indefinitely.
The problem was that AUTOMOC was executed for the qmacstyle
plugin before moc was actually built.
Because of an upstream bug in CMake, AUTOMOC was caught in a deadlock
without reporting that spawning the moc process failed. Specifically
if a libuv spawn() call failed, the condition variable for a waiting
thread was not notified, and the thread kept waiting forever for the
process launch to finish.
Fix the dependency by setting the AUTOGEN_TARGET_DEPENDS property
on all targets that have AUTOGEN tools enabled. This makes sure that
moc and friends are built before they are used.
Also add some special cases to disable autogen tools on certain targets
to break cycles between targets.
Fixes: QTBUG-74636
Change-Id: I6e689e63cba1962525f169f332a58498d173c0a6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
It broke builds because the qconfig.h file was created in the wrong
directory.
This reverts commit 25f67fbb07.
Change-Id: Ia458ef4193a3985a9ba613d82f679b7df5ca0107
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
The feature used to be implicitly enabled because qt source ships with
ANGLE sources, and thus ANGLE could always be built. Yet because the
CMake port of ANGLE is not done yet, and because the feature is
implicitly enabled, the build failed when trying to find GLES headers.
To provide a nicer out-of-the-box configuring of the Windows build,
disable the opengles2 feature on Windows, to default to a desktop GL
build. It can be re-enabled once (if) ANGLE porting is done.
After this change, you shouldn't need to pass any additional custom
FEATURE_foo options to cmake to build qtbase on Windows.
Change-Id: I94c96d8ef70cf671d2ce0198311f70b55fa642b1
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
- vulkan/nolink is not a valid target, instead pass along vulkan
include directories to consuming targets, and don't link to the
library at all
- fix vulkan support target name in the windows qpa dependencies
- the wrong opengl dynamic feature was used in the windows qpa
(the current way is consistent with qmake, otherwise
there were issues with the feature evaluation, because
gui feature definitions are not available in the qpa
project scope)
- fix issue with qfloat16_f16c not being built because
of previous subarch issues
Change-Id: Ia75fc76a71e516fe8718027063fe554657d4d47b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is only a half solution, because some of them need to be set
based on the detected MSVC version and Windows kit, similar to
how it's done by qmake.
Change-Id: Ice13c99d6fe0a033ddfebf9d4be924dcd6b8a36c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In qmake there are at least 2 things to know regarding
sub-architectures and instruction sets.
Which instruction sets does the compiler know to compile for,
represented by the various config.tests and features in
qtbase/configure.json.
And which instructions sets are enabled by the compiler by default,
represented by the configure.json "architecture" test and accessed
via QT_CPU_FEATURES.$$arch qmake argument.
Before this patch there was some mishandling of the above concepts
in CMake code.
The former can now be checked in CMake with via TEST_subarch_foo and
QT_FEATURE_foo (where foo is sse2, etc).
The latter can now be checked by
TEST_arch_${TEST_architecture_arch}_subarch_foo
(where foo is sse2, etc and the main arch is dynamyicall evaluated).
The configurejson2cmake script was adjusted to take care of the above
changes, and the cmake files were regenerated as well.
Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Presumably this was a copy paste that was not intended.
Change-Id: I09e3bb12b3b3f7af75726d7a952d79814ea9c876
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This amends 4f1a155909 and
37b154858f which caused the regeneration
of some json features to be internal. Some of those features were
not evaluated any more unless they were referenced in another feature.
Make sure to explicitly evaluate all internal features as well.
Change-Id: I4367f309585fe29dc89d8a6b793de381956ae51d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Anything that uses Qt::Dbus also needs to link to Qt::Core, so encode
that in the target.
Change-Id: Ibc984d5b5e118aae8d1c0d21117fcff1664b0ae3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make add_qt_executable link to Qt::Core by default. Add a BOOTSTRAP
flag to disable this behavior again.
Pass BOOTSTRAP on from add_qt_tool to add_qt_executable.
Change-Id: I26e7f1e03254122f626b3765cccc0dc4414a4fc0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Allow to override the install directory for Qt executables.
Change-Id: I9561976eefe9c7b573bb97ddaaa39e30d3b6d9fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Report some more qmake variables as used when they are used to decide
which kind of target to write.
Change-Id: Id2602bb8cc07130456c04c53148acb73f21b0f21
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add installation location information into CMakeLists.txt files if
available in CMake.
Change-Id: I498deac71b1cc33c7d30790e32da236afdcb23af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Handle DBUS_ADAPTORS and DBUS_INTERFACES and turn them into
equivalent CMake statements.
Change-Id: Ia8a69e7ab97d9f18df93097a6e2c7c1686cb16a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use the same names for DBus adaptor/interface files that are also
used by qmake. E.g. io.qt.something.xml will be turned into
something_interface.(cpp|h) or something_adaptor.(cpp|h).
Change-Id: I799b8aee7addd1fe590e8f3ec078e5325b68d5b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Treat a relative path in OUTPUT_DIRECTORY as relative to the top level
build directory, not to the current build directory.
Change-Id: I4d409d1362a8f73d13b93cf5ab98e82e60dd62cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- executed pro2cmake script on windows qpa plugin
- added windowsuiautomation platformsupport project
- fixed plugin dlls and lib files to be written to the same path
- fixed an issue comErrorString which used implicit casting
from QString to char*, but plugins are currently built
with QT_NO_CAST_TO_ASCII
Task-number: QTBUG-74140
Change-Id: I5db3b6c5264bbd5dfba2998b049fda36eb312c70
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
- Fix qmake build
- Fix QtNetwork moc-ing, by including the moc files
inside the cpp files
- Fix sql odbc plugin by including QT_PLUGIN define
- Fix Boostrap to link against the Platform target, to get the
correct Unicode and WIN64 defines.
- Fix vulkan headers to be found
- Fix freetype bzip and png unresolved symbols / linker issues
when building minimal platform plugin (also need to make
sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH
because then find_package is overridden, which does magic
to properly propagate static library dependencies).
- Fix qfilesystementry test not to be built without private
tests feature (it led to undefined symbols issues).
- Make sure to remove QT_NO_CAST_TO_ASCII define when building
QtCore, so that the qstringbuilder3 test builds
successfully.
Task-number: QTBUG-74140
Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The new files represent the json features more closely.
This helps with various build issues as well, like dynamicgl
feature not being present before.
Change-Id: I433592f48e0550700226a635492a3ce15af743c1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There were a few cases of feature outputs that were handled
incorrectly before this change, specifically:
- publicFeatures and privateFeatures with custom names
- privateFeatures that also ended up writing defines into
public headers
- publicFeatures that ended up in private headers
- internal features (that should have no QT_FEATURE_foo
defines) that were still written to either public or
private headers
The change takes care of all those cases by keeping a map
of which features need to be written along with any visibility
specifications, as well as custom name changes.
Change-Id: I37baeaeacdfe4935128a392c72ca71b5c3ca1c8d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of generating defines guarded by feature ifdefs,
record the define information (condition, name, value, etc),
and generate the final define statement only if the feature
condition evaluated to true.
This removes the need to generate feature defines
(QT_FEATURE_foo) for features that have neither public nor
private outputs in the configure.json file.
Also note that all qt_feature_definition() calls
(which correspond to type:"define" outputs in json files)
now generate defines only in the public header, which seems
to be consistent with how qmake evaluates json files.
Change-Id: I5210b405d5735dd9df5f7a55d1ea9547bb7b1159
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Certain features like opengles2 can be enabled or disabled based
on the conditions that are specified in the ENABLE and DISABLE
parameters.
Because some of those conditions use STREQUAL with
a single quoted argument, we have to use
qt_evaluate_config_expression to circumvent the CMake bug
regarding single quotes, which is described in the function
implementation.
Only then will enabling / disabling work correctly.
Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Remove qrc files from CMake. Use add_qt_resource function instead.
Change-Id: I64cdbd9498f97d23cd8e03f34ab5ae4a52dba5af
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The script used to write incorrect dependency headers due to not
clearing the qtdeps variable at each loop step.
Change-Id: Icf293be7cea596daa096ab19d390c0bb468a8654
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Handle BASE to give the directory files will be relative to.
* Support lang="foo" for qresource sections.
Change-Id: I36087220d03789a97105dc6dd1aca7a25a063d9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>