summaryrefslogtreecommitdiffstats
path: root/util/cmake/tests/data
Commit message (Collapse)AuthorAgeFilesLines
* pro2cmake: Handle QT_(MAJOR_|MINOR_|PATCH_)VERSION conditionsJoerg Bornemann2022-03-081-0/+8
| | | | | | Task-number: QTBUG-98852 Change-Id: I4c86fff7bbcc6c42cd04094f2409c3d04779597c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Handle optional Qt modulesJoerg Bornemann2022-03-081-0/+4
| | | | | | | | | ...and write a separate find_package(Qt6 OPTIONAL_COMPONENTS Foo Bar) call for those. Task-number: QTBUG-96799 Change-Id: I3386487774c386edde6767dca92ce433bfed906e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Add a blackbox test for converting from qmake to CMakeJoerg Bornemann2022-03-081-0/+3
| | | | | | | | | If you can set the environment variable DEBUG_PRO2CMAKE_TEST_CONVERSION to 1, the output of pro2cmake is written to the temp directory. This helps analysing test failures. Change-Id: Ida42c5b76a67172d00ce0d2488adc7fb376c6b11 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Handle qmake condition operator precedenceAlexandru Croitor2022-02-281-0/+11
| | | | | | | | | | | | | | | | Unfortunately qmake does not have operator precedence in conditions, and each sub-expression is simply evaluated left to right. So c1|c2:c3 is evaluated as (c1|c2):c3 and not c1|(c2:c3). To handle that in pro2cmake, wrap each condition sub-expression in parentheses. It's ugly, but there doesn't seem to be another way of handling it, because SymPy uses Python operator precedence for condition operators, and it's not possible to change the precendece. Fixes: QTBUG-78929 Change-Id: I6ab767c4243e3f2d0fea1c36cd004409faba3a53 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-1/+1
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add support for converting qtTargetLibrary() value assignmentsLeander Beernaert2019-08-081-0/+2
| | | | | | | | | | | | | | | | | | Add support to pro2cmake to handle variable assignments via functions, e.g: TARGET = $$qtTargetLibrary($$TARGET). The evalulation of the functions happens during parsing and is very rudementary in nature. Currently it only covers the qtTargetLibrary(), required for certain projects, and quote(), required for passing unit tests. If we run into any unhanlded function an exception will be thrown. This patch also changes the TARGET property on Scope to expand the value. Change-Id: I678b7058067348a3972944bdba110f556cf22447 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Improve qmake syntax parser in pro2cmake.pyAlexandru Croitor2019-05-233-0/+7
| | | | | | | | | | | | | | | | | 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>
* Fix the fix to correctly handle comments in multi-line assignmentsAlexandru Croitor2019-05-201-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix parsing qmake assignments that have comments in betweenAlexandru Croitor2019-05-171-0/+4
| | | | | | | | | | | | | | | | 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>
* CMake: pro2cmake.py: Simplify code and add test for line continuationTobias Hunger2019-02-281-0/+10
| | | | | | | Simplify code a bit and add a test for line continuation fixup. Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle for loops without blockTobias Hunger2019-02-281-0/+4
| | | | | | | | 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>
* CMake: pro2cmake.py: Make \$\$QT_FOO work in assignmentsTobias Hunger2019-02-281-0/+2
| | | | | | | This broke somewhere along the way. Add a test for this. Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Fix parsing of Line continuation before end of fileTobias Hunger2019-02-281-0/+3
| | | | | | | ... and add a test case for this. Change-Id: If20d737b54ecb3f9e128e59070b238c840acad6c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Fix parsing of for loopsTobias Hunger2019-02-281-0/+11
| | | | | | | 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>
* CMake: pro2cmake.py: Handle complex conditionsTobias Hunger2019-02-281-0/+4
| | | | | Change-Id: Ifb047e5736f1831ddbd65b210e760c2729378334 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle values with () in assignmentsTobias Hunger2019-02-271-0/+2
| | | | | Change-Id: I0f59c7fa57cd6c64b151f439d4eea4ae56dca288 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: Better parsing of scopes with elseTobias Hunger2019-02-274-0/+31
| | | | | | | | 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>
* Begin port of qtbase to CMakeSimon Hausmann2018-11-0115-0/+96
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>