Changes:
- Make sure the footer is passed along to callees
- Make sure RESOURCES are part of add_executable(...) for AUTORCC
Change-Id: I4546bacd2e41ca8acc1a9351af54d325afb715ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit introduces infrastructure work to allow static builds of Qt
to handle importing of plug-ins.
Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qtdeclarative has a few conditions that check the gcc version
via variables like QT_GCC_MAJOR_VERSION.
To handle that, parse the CMake compiler version using
qt_parse_version_string() into separate variables like
QT_COMPILER_VERSION_MAJOR, QT_COMPILER_VERSION_MINOR and
QT_COMPILER_VERSION_PATCH. We can then map the conditions
appropriately.
Also, handle isEqual(foo, bar), which is equivalent equals(foo,bar).
Change-Id: I74575c733b44f1f42451e00038b3f113fd353915
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Hardcode a few cases regarding scopes containing "qtConfig(opengl)".
These arew few, and contain regular expressions, to just manually
check and replace them.
Add a new entry to _qt_library_map for handling QmlModels module.
Fix Scope.children property to recursively access the .children
property on included scopes (instead of just ._children) so that
we get the full list of scopes from included children that include
other scopes. This is needed for nested .pri files.
Fix mapping of "win*" to WIN32.
Change-Id: If949a8051f517683e56cda605733719daadb384a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Qt CMake Build Bot
* Generate module .pri files
* Generate qconfig.pri
* Propagate MODULE_CONFIG from the .pro files
This enables the basic use-case of simple application builds that for
example use the moc. Omitted from the patch is support for private
module configurations, prl files (should we do this?) and possibly more
hidden gems that need to be implemented to for example support building
Qt modules with qmake.
Task-number: QTBUG-75666
Change-Id: Icbf0d9ccea4cd683e4c38340b9a2320bf7951d0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When we replace the PWD key from qmake files and both the base and
current directory are the same, there's no need to add an extra './' to
the current working directory.
This also fixes a unit test in qtsvg as it requires the passed in path
to match exactly to the one outputed in the log files.
Change-Id: Ide9ca6a70493e8039d3af84a9e576d8f6a313f2a
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
These were some hard requirements while porting QtQml .pro files so
that the generated CMake code is syntactically correct and the result
buildable.
This include handling of a few more different condition scopes
and disabling the c++ make_unique feature test.
Change-Id: Iae875ffaf8d100296e8b56b57d076455e5d72006
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some configure.json files contain new lines inside quoted strings,
which is not conformant with the JSON spec.
Add a new json_parser python module which uses pyparsing to preprocess
the json files to remove the new lines inside the quoted strings, and
then hands over the preprocessed content to the regular json module.
Change-Id: I5f8938492068dda5640465cc78f5a7b6be0e709a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
We constantly had to adjust the qmake grammar to handle line
continuations (\\\n) in weird places. Instead of doing that,
just do a preprocess step to remove all the LCs like we do with
comments, and simplify the grammar not to take into account the
LCs.
From some manual testing it doesn't look like we get any regressions.
Change-Id: I2017d59396004cf67b6cb54977583db65c65e7d3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
setName() and setDebug() need to be called on a parser element before
the parser element is used as a sub-element in another parser element,
otherwise the debug output is not shown.
Hence the "iterate over all locals" approach works only partially.
Instead add a new decorating function add_element() for the
construction of each parser element, and make sure to enable debugging
inside that function.
Unfortunately there is no clean way to avoid duplicating the parser
element name both in the local variable and in the function argument.
Change-Id: Iaa9ed9b7dbb22ec084070b9c049cf51c841d442c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Some qtdeclarative pro files caused exceptions when trying to parse
them using the script. This included the following:
- handling conditions divided by newlines and backslashes
- handling conditions that have no scope
The parser has been fixed to deal with those cases and relevant
tests were added.
After the change, all qtdeclarative project files are parseable by
the script.
Change-Id: Ib9736423f7fb3bcc1944b26cfb3114306b4db9a7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Override the default debug actions to be decorated with proper
indentation for easier reading.
The setup only has to be done once, and not on each QMakeParser
creation.
Change-Id: If5f965b462c782c654ee8ebfdd33570e8f94b084
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Before this patch we enabled AUTOMOC, AUTORCC, AUTOUIC for all targets
that did not opt out.
Aside from being wasteful from a performance point of view,
this also caused issues when trying to build qtimageformats which
does not depend on Widgets which is the package that exposes uic.
To avoid this, enable only AUTOMOC for all targets by default, and
UIC and RCC can be opted in via the ENABLE_AUTOGEN_TOOLS option.
To facilitate this some refactoring had to be done, like moving some
common setup for all autogen tools into a separate call, and making
sure that extend_target understands the autogen options, because some
ui files are only added conditionally.
Also the conversion script has been adapted to output the
ENABLE_AUTOGEN_TOOLS option whenever a .pro file contains at least
one FORMS += foo assignment.
Note that we don't really use AUTORCC while building Qt, so nothing
opts into that at the moment.
Task-number: QTBUG-75875
Change-Id: I889c4980e9fb1b74ba361abed4044737f8842ea4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The previous fix where the Grammar comment style was changed to
remove the newlines was incorrect, because if you have
foo=1#comment
bar=2
after the Grammar comment ignoring, it would transform into
foo=1bar=2
which will clearly fail to parse, so the new line has to stay.
But we would still have the following case which would fail:
foo=a \
# comment
b
Apparently qmake things that's the equivalent of
foo=a b
but the grammar parses it as
foo=a \
\n (newline)
b
Thus the parsing fails because there's a newline and then some
weird 'b' token which the grammar does not expect.
The best fix I found is to preprocess the source, to remove
completely commented out lines.
So:
foo=a \
# comment
b
gets transformed into
foo=a \
b
Change-Id: I2487a0dbf94a6ad4d917d0a0ce05247341e9b7da
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
cmdline implies console, so use that also to determine if a binary
should get a GUI flag.
Change-Id: I084e0a45785df96a7dc2c101af5305fbb39efbc3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
There are still call sites that call Operation.__init__ with a string
instead of a list. Restore the handling of such a case.
Amends 5fe8a38af3
Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
and plugins.
src/network/network.pro for instance depends on core-private, but
because we ignore adding QtCore as a public dependency, the exported
Config file for Network doesn't depend on QtCore anymore, so if a user
only links against Network, they won't automatically link against
Core.
Change-Id: I4a60ffae7e071927360b8ccf6b1b7479ab391060
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
For some reason the python comment regex that we used does not ignore
the line break at the end of a comment line.
This caused issues when parsing multi line assignments with comments
in between.
Use our own regex for comments to circumvent the issue. It was found
while trying to port the qtimageformats repo.
Added a pytest as well.
Change-Id: Ie4bbdac2d1e1c133bc787a995224d0bbd8238204
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Fix test_operations and do some small mypy cleanups along the way
Change-Id: I6586b5d3491e5dcf44252c098516f0922fa60420
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The pro2cmake.py file is now smarter, and can reapply "special case"
modifications after regenerating a CMakeLists.txt file.
This substantially lowers the maintenance burden when regenerating
many files at once.
See the special_case_helper.py file for details on how it works.
Make sure to commit the generated .prev_CMakeLists.txt file alongside
your CMakeLists.txt changes.
To disable the preservation behavior, you can pass -s or
--skip-special-case-preservation to the script.
To keep around temporary files that are created during this process,
you can pass -k or --keep-temporary-files.
To get more debug output, pass --debug-special-case-preservation.
Fixes: QTBUG-75619
Change-Id: I6d8ba52ac5feb5020f31d47841203104c2a061d8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Separate the logic to find all used libraries from the code that writes out
the link_library information into the CMakeLists(.gen)?.txt files.
This patch will remove some "PUBLIC_LIBRARIES Qt::Core" from generated files.
This is due to us handling some Qt libraries in special ways in some of our
add_qt_* helpers. These special libraries were added to the LIBRARIES section,
but actually they should be added to the PUBLIC_LIBRARIES section instead. Do
so now, so that the newly generated files do not break things again.
Change-Id: I588781087a8aecc4d879e949735671d8085f0698
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extract the actual functionality to write a list of "things" below
headers and/or cmake parameter and followed by a footer.
Reuse this functionality everywhere we write a list of things.
Change-Id: Ia7647be465b4788a2b1e6a5dbede1ca868f24ae2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Examples need to be built stand-alone and as part of Qt, so they
need a special CMakeLists.txt file that supports both use-cases.
Add an --is-example switch to pro2cmake to make it generate these special
CMakeLists.txt files.
This is basic support only and is currently still missing the necessary
find_package calls.
Change-Id: Ie770287350fb8a41e872cb0ea607923caa33073d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Otherwise if you call the script from a different directory, path
handling becomes broken and certain files are not found.
Change-Id: Ia2f60abbd312a771330b3d5e928e1ccd0b4a845b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Fix library substitution again which broke when I merged all the
library related pieces of information.
Keep Qt and 3rdparty libraries separate so that dbus does not get
mapped into Qt::DBus (or the other way around).
Make names in helper.py more consistent while at it.
Change-Id: I5e5bf02bdabf8bafe991c5701deca76bde4df2c3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Merge all data related to mapping libraries into one data structure
in helper.py.
Use that data for everything related to library mapping.
This change enables way more features now like e.g. adding find_package
calls into generated files.
Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Add a helper function to QtBuild that generates Foo_nolink versions
of Foo library targets.
Map 'Foo/nolink' libs found in qmake to Foo_nolink.
Automatically run helper function to create _nolink targets as
part of extend_target.
Change-Id: I4c23ea68b3037d23c9a31d4ac272a6bd0565f7c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch makes sure to store unchanged filenames as taken from qmake
into the scopes it creates.
The scopes are then kept longer: Merging/including scopes is handled by
adding the scope to a private _included_children member of the parent scope.
The methods to access data from scopes are then changed to take the
_included_children into account and a new "get_files" method is added,
that does all the necessary mapping to handle scope-dependent things like
$$PWD, etc.
This makes sure src/network is converted correctly incl. all the .pri-files it
includes as well as src/platformsupport/themes.pro. Both have been troublesome
before.
Change-Id: I28e92b7bcee1b91b248c17201c2729a54a3ce4a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Include the current directory in the scope __repr__ output to make
it easier to understand where things wrt. include or file names go
wrong.
Change-Id: I09a6c17c6d8d547f1f64801bcde3c2e10c925ee1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The actual variable that contains the architecture is
TEST_architecture_arch. TEST_architecture only contains the value
if the test was performed or not.
Fix the conversion script and all the generated files.
Change-Id: Icb3480832cab894948f4fef03b8bc8187cab6152
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Previously a condition like APPLE AND (NOT APPLE_OSX) got simplified
to APPLE, which is wrong.
This happened by accident due to some sub-family simplifications
involving BSD, which APPLE was part of.
Technically APPLE is BSD derived, but for the purposes of the
conversion script consider APPLE not to be a BSD (hopefully there
should be no cases of using the bsd scope for apple machines in
qmake files.
Also regenerate the fontdatabase project, where the issue was found.
Change-Id: I18dcf4f29ffbff48c183ba95ca2a2e5cd5325d86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
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 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>
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>
Remove qrc files from CMake. Use add_qt_resource function instead.
Change-Id: I64cdbd9498f97d23cd8e03f34ab5ae4a52dba5af
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Add BOOTSTRAP for tools that need it automatically.
Change-Id: I33b2ec16dfcb09709f844ed232ce9974a9d7c7ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Simplify code a bit and add a test for line continuation fixup.
Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Handle for loops with a single line of instructions and add a test
for that.
Change-Id: I041ae30f64abcbd3db7df29933647f047b92ede3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This broke somewhere along the way. Add a test for this.
Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Ignore for loops in the pro2cmake.py parser and add a unit test for that.
Change-Id: I2a0c075c45cf56f4f24ada2d53e8e8e94ce19f26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Warn on broken line continuation in .pro-files, but fix up the issue
and proceed.
Change-Id: Ibe68011b312bcea25620ce790a0b44b2983fbd88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Improve the code that simplifies conditions to take "OS families"
into account. E.g. if a system must be ANDROID, then it is redundant
to express that it is NOT APPLE_OSX.
Change-Id: Ib7e62726c309bf84b9e5e0d6a6e3465511db0ead
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Parse conditions more exactly as before, enabling proper handling
of else scopes.
Change-Id: Icb5dcc73010be4833b2d1cbc1396191992df1ee4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
so use map_qt_library instead of map_qt_base_library
Change-Id: I4dd0097fff3ffd9ec4aad36d11d79ea23a08cb90
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There is no need to try and avoid extra () and NOTs: Those will be
removed by sympy later anyway.
Change-Id: I39d3e4d1d829579e532bfbbf6c69e0f1e06e9a22
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Treat ANDROID_EMBEDDED as ANDROID when simplifying conditions.
Change-Id: I2cf0ea1e1a3e882e3a7b7276867dcee452866ade
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Do not go into an infinite loop when replacing a variable with itself.
Change-Id: I2765b1c0c567753f26ca75e0533c1d193362b456
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
This adds an overly simplistic mapping -- just like it does for the
rest of the qmake test functions.
Change-Id: I0c9e3b70c1c3d0c68a245706a141aa7b7cb4d8bf
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Expand qmake values when dealing with source file names, include
directories and more. This handles cases where variables are used
to refer to sources (e.g. $$VERSIONTAGGING_SOURCES in corelib) as
well as things like $$QT_SOURCE_TREE and friends.
Note that $$PWD and $$OUT_PWD are still need hand-holding since they
refer to the scopes directory relative to the top level directory --
which pro2cmake.py does not know.
Change-Id: I011ef55416ff820053d5f844b3008836849f5075
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
.pro-files support things like contains(Foo, bar), etc.
Map that in such a way that only one identifier will be visible to
CMake to unconfuse the logic handling on that side. These conditions
will need manual fixup later!
Change-Id: Id4946e694a9adccf9f54bcce26a6c227cd921007
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Remove leading './' from paths before writing them into CMakeLists.txt.
Change-Id: I5680a3470cf491a8805b559197f94f8e6a6ce9b7
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Fix handling of things like:
foo:bar:buz: {
do something
} else: wat {
do something else
}
The else relates to foo AND bar AND buz, not just to buz in this case.
Change-Id: I40d1fa295b4d6dd95ae5e1ce2d58372edc807b86
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Map the dlopen feature to 'ON'. The effect is that cmake will figure
out whether or not linking to 'dl' is necessary or not.
The user-visible feature is 'library' anyway: That enables dynamic
library loading -- and will link in 'dl' as needed.
Change-Id: I0d68275a7234efba7f926150f120bb37b4a1163f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Dump scope trees for all scopes that contain a variable
'PRO2CMAKE_SCOPE_DEBUG' (set to any value).
Change-Id: If17bb1697a32ccaa427a858c2330ab2b019d0fa8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This makes scopes much simpler to destinguish from each other.
Change-Id: I1af42f181b5899aba749bcf9267a345385149f90
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Show the total_condition (if set) when dumping a scope.
Change-Id: I9dfe98c2251f1d28881771042f17d723cedc8907
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Generate debug output whenever a qmake scope with a variable
'PRO2CMAKE_MERGE_DEBUG' is involved in a scope merge.
Change-Id: I0ad94b881db9930de689c199adbac084efe6c03b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Convert QMAKE_USE, QMAKE_CXX_FLAGS and QMAKE_LFLAGS into CMake.
Change-Id: I53a5b91664b6ab71892d4381c00f8d744d7d7abd
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Make use of @property to make code a bit nicer.
Change-Id: Iff0bfed57874cf13b7e5f85acde2660a397933d7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Qt 6 will use external libraries for everything, so
default all QT_FEATURE_system_foo to "ON".
Change-Id: I884a4293c64487271be08de5fab82e6858d0a2ed
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove scopes with condition 'OFF'
* Merge scopes with identical conditions
This e.g. merges children with a condition that simplifies to
'ON' with their parent scope.
Change-Id: Ieb3d60e1234f189ac45869853555ca8c0cfb5c76
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>
Add a comment that a library was removed when running into "QT -= gui"
and similar lines.
Change-Id: I17b7922827f228c6b45e1e6867fdc5e316af3781
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Map "qtHaveModule(foo)" in qmake to "TARGET Qt::Foo" in cmake.
Change-Id: I63c251f0f2dfd2e95adc996a83b528e9b4e9636e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>