Use pysym to simplify conditions in extend_target.
Do some manual changes to the condition based on domain knowledge.
Change-Id: I7fbb9ebc93b620a483c6a3a796d84c9bc0e36ef7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Add some more mappings from qmake to CMake equivalents conditions.
Change-Id: I57b7bea9d6628e1c2b8d6ae88f799219942b571e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Make sure complex things in qmake (e.g. function calls, etc.) are
mapped better to cmake. When there is no way to properly map the
qmake construct, then make sure to map everything into one
identifier.
This is to keep the structure of the condition simple.
Change-Id: I6d88e0cb85fce1041bbfdc96604dab7bd4e65856
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Return the current scope's condition, not the total condition from
recursive_evaluate_scope. That is the part the "else" referrs to.
The parent_condition stays identical for all branches, so that should
not get negated.
Change-Id: I0da91483d4d748d01a29ac16890d709d8d659843
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This should somewhat simplify the generated CMakeLists.txt files,
especially in complex cases like corelib or network.
Change-Id: I208c8f99a64cbb6c97d51dd3ae428bb234982202
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Fix pyls warnings in pro2cmake.py as well as its tests.
Change-Id: Ib8ee1daa9b97735d13c0fde43616daa46de9e171
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
CMake's moc file scanning is rather primitive: It will run moc on any
file containing a line that starts with Q_OBJECT (and similar macros).
We have four files in QtBase that contain such a macro at the start
of the line in a qdoc comment. These four files were excluded from
automatic moc handling by cmake, which is not ideal, since this will
silently fail when somebody actually adds a Q_OBJECT macro in code.
This patch introduces a macro Q_OBJECT for qdoc. This macro will be
replaced with Q_OBJECT in the generated documentation. While not nice,
at least a failure to use \Q_OBJECT is noticeable: Moc will warn about
the file.
Change-Id: I829893c1166eee306fe30058d4ea0256affd45ea
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Report more error conditions in debug dump and make the output
easier to read in the non-error case by wrapping all strings in
"".
Change-Id: I3c99deda3dfa27dcc0c9ce2800bfb891747e6934
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Having a good representation is nice, but unfortunately very hard: pro2cmake.py
sees just a small part of the entire qmake build system at a time, so the information
it has is incomplete to start with. It is not worthwhile to pass the supposedly full
information around -- which will then need to get de-duplicated again -- considering
that the information is not complete in the first place.
So go back to the simplistic approach we used earsier. That is good enough and does not
suffer from the problem of having multi-part arguments getting messed up when the
scopes get de-duplicated.
Change-Id: I553329650d6b8046f7ad8b1282e3d0c961293a28
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This makes it easier to see what is still missing.
Change-Id: I186abd609f20be680ac0943ac89068f764142a79
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Do not add scopes that are going to get merged into their parent scope
as a child of the parent scope. This leads to the information of the
child scope being duplicated.
Change-Id: If4d6a83b9c9eac477959e7774e9cf65fd4df98e6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Indent the individual parts of a scope relative to the scope itself.
This makes things a bit more readable.
Change-Id: Iffbffd69bc960118f9657a1b7fb488da3c7b48dd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This avoids some includes being done several times: We used to generate
scopes for the include files, add them to our current scope and then
traverse the children of the current scope.
Switch the order to avoid traversing the newly added scopes twice.
Change-Id: Icb9c53c9f54772d3305e0fb121824c23d5469e09
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Ignore include files that go into 3rdparty code. Qt 6 should work
with external libraries, so there is no need to drag in 3rdparty
include directories, etc.
Change-Id: I990f3a8a4983e1458843b4122420b9daec763ccb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Do not needlessly add () and NOT all over the conditions.
Change-Id: If907357306eb3f8ab5b2878bcad5902171a90476
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Make the output of the project structure debug dump more readable.
Change-Id: Ib80b41f7fdb8e14ff878284c46f3760d84f4f004
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: Ieb33141601c29ec2f3c30c6725179f1fb234e53a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Set new keys in the parent scope instead of just appending to existing
scopes.
Change-Id: I901c3f418429d8aed56acb39b1dbe566c5468920
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: Ice9db97db5bf1fb347bff07bcaf91daac87fa983
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Do not include the same file over and over again...
Change-Id: Ia0748b9ebe58388549ba23ec7e24ce3d9b738987
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is less self-contained than what we have, but significantly speeds
up cmake configure/generate runs.
This patch also warns when a feature is already defined.
Change-Id: I8cab63e208ba98756b47d362a39b462f5ec55e20
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Remove some unnecessary sorting, speeding up cmake by about 10s on my machine
Change-Id: Ieafbd16f6dd8cfe6d1af3c739bfe58e8bf724441
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Make it a bit harder to mis-use qt_pull_features_into_current_scope.
Change-Id: I2a6be28d7c0e6207217cb1908ec22cc757acd01a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This simplifies the handling of features a bit as it removes the special
code to store two sets of features in Qt::Core.
Change-Id: I536d41cfc76a02af054e3cfbad6bda50b1e9e49a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Because AUTOMOC/AUTOUIC/AUTORCC got merged into master.
Change-Id: I0ddfd4443a9892fae1dca54d75b97af4c69ad7ef
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
During qt_feature_begin_module no features are changed, so there is
no need to push features.
Change-Id: Id7ebcfad373caa284e790b7eb0a178eaa72216e5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Only import features once
* Move Core specific code into its CMakeLists.txt file
* More consistently use target names like "Core" to
refer to "Qt modules". We tend to require either "Core"
or "QtCore" in places, which I find confusing.
Change-Id: Id54161bc5468412750cb9eb7eeb15de3812e8a09
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
... and fix the fallout of this change. It results in more targets being
passed overall (instead of a strange mix of targets and module names),
so this is a good thing(TM).
Change-Id: I1c4326b80e2c6675356587879ec8471ef7249a50
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
For Qt6 we want to have Qt6::foo and Qt::foo. Enable that consistently.
Change-Id: I3cf05c4171b13029bf508d307945e8be4687e86b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Do not try to push features up into the parent scope if none were added.
This avoids a lot of iterations over all defined variables.
Change-Id: Idb9a4c86643c0ca773584a05b3a0590cfab7514d
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Add a simple test for moc-file handling and fix the implementation
to make the test pass.
Change-Id: I34e8d65a5e01a6f557d3a3d8cb262fd147ad78e4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>