summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
...
* | cmake scripts: fix test_scope_handlingFrederik Gladhorn2019-10-101-1/+1
| | | | | | | | | | | | | | The file parameter for a new Scope got renamed to qmake_file. Change-Id: I6cb9d010892f3e3132fac09eead1dbf45d6ba86d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add install directory for plugins without typeLeander Beernaert2019-10-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we run into a plugin that does not have a type and is not a qml plugin, we try to see if we can find the target installation path and provide INSTALL_DIRECTORY AND ARCHIVE_INSTALL_DIRECTORY to the add_qt_plugin call. We run into this frequently with the unit tests. This patch also changes add_qt_plugin() to use the value provided in INSTALL_DIRECTORY for ARCHIVE_INSTALL_DIRECTORY if no value is provided for the latter. Change-Id: I61278904a4d2d72308079cd362bd085b4e2f540c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | cmake scripts: add mapping for mkspec conditionsFrederik Gladhorn2019-10-101-0/+7
| | | | | | | | | | | | | | | | Improves for example tests/auto/tools/moc/moc.pro conversion. Change-Id: I80f82be75299a0407be510824df35f0ea101c0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Make condition cache work well with run_pro2cmakeAlexandru Croitor2019-10-102-6/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using run_pro2cmake, multiple pro2cmake processes try to access and override the condition cache. Make sure that reads / writes of the cache file are protected by a file lock, and the content is merged rather than overridden. This requires use of a new pip package, portalocker. The script will tell the user to install it if it's missing. Change-Id: I44798c46ff0912981b186bec40e3e918f249fb4d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | cmake scripts: when writing resources, replace OUT_PWDFrederik Gladhorn2019-10-101-1/+2
| | | | | | | | | | | | | | Needed in tests/auto/corelib/plugin/qfactoryloader/test/ for example. Change-Id: I5a2904e25d2895355fe11d4fc3e2e7c742346e42 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Use regular -framework for examplesLeander Beernaert2019-10-091-7/+12
| | | | | | | | | | | | | | | | Do not replace framework libraries in examples as they tend to use only system level frameworks. Change-Id: Ide604b3ecc90f1f4c81b9ddaaa8e0a5acb486080 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Extract public/private libraries from scope for ExamplesLeander Beernaert2019-10-091-2/+5
| | | | | | | | | | | | | | Public/public libraries were always processed from the global scope. Change-Id: I1223f04f100f91790ced1da41fda2fb9b52c5987 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add scope conditions for examplesLeander Beernaert2019-10-091-29/+57
| | | | | | | | | | | | | | Update example conversion to process scopes and conditions. Change-Id: If1bbbd25092a8d5371b2d1fa2830d91e5aa591c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | cmake scripts: Do not add empty child conditions into condition listFrederik Gladhorn2019-10-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | c.condition can be None, there is no point in adding it into the set of conditions. An example is tests/auto/corelib/codecs/qtextcodec/test.pro Initializing the set to an empty set instead of None makes mypy happy, since we could otherwise end up passing None where frozenset was expected. Change-Id: If88a86d810b4c55aae7f1ee97a62db559abfc86d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | cmake scripts: fix conversion of qmldir filesFrederik Gladhorn2019-10-091-1/+3
| | | | | | | | | | | | | | | | | | I broke the depends in 3a103b360802b81318a20063f2b4884864e79b15 wrongly assuming it was dead code. Bring it back and actually fix the type to be a list of tuples. Change-Id: I96f04843ff2e2293969b5ba0efe02fb51dc88404 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Correct Examples install directoryLeander Beernaert2019-10-091-1/+6
| | | | | | | | | | | | | | | | | | Set the example install directory based on the path specified in target.path qmake property. Change-Id: Ia791995a3241fbf2f5ea1e48f2b9f93a90f1c3d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | cmake scripts: more type cleanupFrederik Gladhorn2019-10-094-7/+5
| | | | | | | | | | Change-Id: Ic32394548bb997af96756f260b453e830d8b9e9b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | cmake scripts: fix type issuesFrederik Gladhorn2019-10-093-71/+70
| | | | | | | | | | | | | | | | Some of the changes are just cosmetic, but a bunch of them must be bugs, such as mixing lists and str randomly. Change-Id: Idd8340e17bcea7af3b87e595e251e13f5df1aa3f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | cmake scripts: do not redefine built-insFrederik Gladhorn2019-10-083-19/+19
| | | | | | | | | | | | | | | | Try not to override built-ins, the code becomes confusing to editors and people. Change-Id: I9e9421e1506a206551ccfc550f882a075e208181 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Ignore QTRO_SOURCE_TREE if unusedAlexandru Croitor2019-10-081-0/+1
| | | | | | | | | | | | | | | | | | | | Gets rid of new flood of QTRO_SOURCE_TREE unused commented lines when regenerating projects. Amends 152c593423ee42c9197bf2b6f7e9e44e9fd6111b Change-Id: I5485643459078cd53face3080aa600df7d082595 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | pro2cmake: Handle QTRO_SOURCE_TREEJoerg Bornemann2019-10-081-0/+1
| | | | | | | | | | | | | | | | ...which is the source root of qtremoteobjects. Set to CMAKE_SOURCE_DIR for now. Change-Id: I6797e170749ed01bbc1bac4daa7709d3aae1f84b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Handle REPC_{SOURCE|REPLICA|MERGED}Joerg Bornemann2019-10-081-0/+14
| | | | | | | | | | Change-Id: I7c058bdc5a93038e7b67a727125c315062560d8f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Handle QLALRSOURCESJoerg Bornemann2019-10-081-0/+13
| | | | | | | | | | Change-Id: I8e6b2d542c96947d487b934c27544a8a4ae8745c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Use get_files for STATECHARTSJoerg Bornemann2019-10-081-1/+1
| | | | | | | | | | | | | | ...to get proper variable replacements. Change-Id: I533a6abfbc7721313840fd75125eeaa7b26f2eba Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Update add_qml_module() to use INSTALL_QML_FILESLeander Beernaert2019-10-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | Update add_qml_module() to use the new INSTALL_QML_FILES argument from qt6_add_qml_module(). This patch also updates pro2cmake.py to remove the QT_QML_SOURCE_INSTALL property from qml files. Change-Id: I6623b2de76bb55bd6750e48f7d45c53ca536b391 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | pro2cmake: Allow skipping regeneration of a project via inline markerAlexandru Croitor2019-10-081-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a CMakeLists.txt file has the special marker # special case skip regeneration then pro2cmake will skip the convertion of the .pro file that is present in the same folder as the CMakeLists.txt file. The --ignore-skip-marker can be used to force conversion of such a project file. Change-Id: I73aae742d1843148b5c22217cb3fc6b0f8e87b82 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | run_pro2cmake: Fix the file preference sorterAlexandru Croitor2019-10-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | When invoking the script with "." as the only argument, and there are multiple .pro files in the current directory, the script would not choose the correct preferred .pro file (the one that has the same name as the current directory). Fix the sorter to handle such a case. Change-Id: I6df70d7c577649f8854bca9b8879f13bdb1b4d26 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | pro2cmake: Don't add default Qt libraries to bootstrapped toolsAlexandru Croitor2019-10-071-1/+7
| | | | | | | | | | | | Change-Id: I3ccc20ed5fcd2eaceb5af09df4a8bf7ccb2d525f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Handle parentheses in if() scopes betterAlexandru Croitor2019-10-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The unwrap_if handler just removed the if keyword from a condition expression, and return the rest of the condition as-is. This proves not be enough, because map_condition splits on spaces and tries to map platform keywords, which would fail for values like "unix)". Change unwrap_if to add additional space between the values in the parentheses. Change-Id: I769ab430363d008a9fd91eaba014c88bd5ee43bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Fix QT_BUILD_TREE variable mappingAlexandru Croitor2019-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | CMake doesn't have a PROJECT_BUILD_DIR variable, but it does have a PROJECT_BINARY_DIR variable. Note that this might still be the wrong thing to do according to 35a30c7ebbd50e8b5b1fad7c00bd6c36b0dca8b9 , but it's still somwehat better. Change-Id: I493f82a791d933a16011d91774aaac4bcaffc5e5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Allow disabling condition cacheAlexandru Croitor2019-10-072-2/+19
| | | | | | | | | | | | | | | | | | New option --skip-condition-cache allows forcing recomputation of condition simplification. Useful when debugging certain condition mappings. Change-Id: I68a85c2e4085ad7a3043d7334db71a334a6469e9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix pro2cmake.py path replacementFrederik Gladhorn2019-10-071-1/+1
| | | | | | | | | | | | | | I forgot to add .items() in ed35e1ac845cfa1e4f3e46983f0d4c39d9ea0a4f. Change-Id: Ic46134daffa8f1a1b5b59040c8bcca76d32dbb35 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | CMake: clean up target.path and DESTDIR replacementsFrederik Gladhorn2019-10-071-7/+20
| | | | | | | | | | Change-Id: I0891008cff939aa98b39a28a23710add0781901e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | CMake: allow $$[QT_INSTALL_PREFIX]Frederik Gladhorn2019-10-071-0/+2
| | | | | | | | | | | | | | This is used in QtPurchasing. Change-Id: I29c3a87d844eeaf3fd1b64057e33d64054f14a89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | cmake: add tests in corelib/serializationFrederik Gladhorn2019-10-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The DEFINES -= QT_NO_LINKED_LIST is no longer needed, so just remove it from .pro and CMakeLists.txt. Handle $$[QT_INSTALL_TESTS] and $$TARGET in target.path. When we have DESTDIR set, do not use target.path for OUTPUT_DIRECTORY. Fixes: QTBUG-78219 Change-Id: I5161a955b25ff2f3b35428dc4b935a7c9d2d425b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* | Add expansion for QQC2_SOURCE_TREELeander Beernaert2019-10-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | Test in QtQuickControls2 rely on this variable, which basically points to the root of the project. We can't use PROJECT_SOURCE_DIR since it will vary depending on whether we build tests as stanadlone or part of the build. Change-Id: Ic59a79af2b4b62611d6c32391c936e98e469dea0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* | cmake: add more tests in corelib/threadFrederik Gladhorn2019-10-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This fixes the qatomicinteger magic by making $$basename work for one particular case. qthreadstorage still needs investigation. Task-number: QTBUG-78221 Change-Id: I7bb38f6ca24273bcf0443ab25685c8e815814c3c Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Make SDL2 library-mapping use a wrapperMårten Nordheim2019-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | Since at least one system provides config files without an included target. Change-Id: If1f336aab4cec9704412349d7951849ee8c3dabb Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | pro2cmake: Handle SOURCES subtractionsAlexandru Croitor2019-10-011-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SOURCES -= foo.cpp statements should now be handled correctly by the script. The script uses the same principle as for subdir handling: go through all scopes to collect source removals, and then generate new scopes with total conditions that take into account both additions and subtractions and their conditions. Should handle NO_PCH_SOURCES case as well. Tested on gui.pro, network.pro and qtconnectivity bluetooth.pro. Change-Id: I0cc913ef64cecf09e8ada4e6a3ce3ccb4365b44e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Implement persistent caching for simplify_conditionAlexandru Croitor2019-10-012-1/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the results of simplify_condition in a json cache file, next to the pro2cmake.py script. Dramatically speeds up re-conversion of projects. The cache is cleared whenever the content of the condition_simplifier.py file changes, effectively presuming that the condition computing code has changed. Sample times. Initial corelib.pro conversion - 142.13 seconds. Next re-conversion with hot cache - 1.17 seconds. Change-Id: I8790b2736358236e4b23bcb5f10f45a36fdfa426 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | Move sympy condition simplification code into separate fileAlexandru Croitor2019-10-013-206/+239
| | | | | | | | | | | | Change-Id: I3f062bf939b452bb41b7a27508a83cbf93abff8c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | CMake: Generate wayland protocol code for examples as wellJohan Klokkhammer Helsing2019-10-011-1/+6
| | | | | | | | | | | | Task-number: QTBUG-78177 Change-Id: Id1c49013244e5ba51b99c1538b314181efe786fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Add qtremoteobjectsJoerg Bornemann2019-10-011-0/+1
| | | | | | | | | | | | Change-Id: I6cb2ee0c83e0dd3bf830a063f5790e35cbf73285 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Add CMake support for directfb plug-inJean-Michaël Celerier2019-09-301-0/+1
| | | | | | | | | | | | Change-Id: I126545e1da54018ce081b42a29e62ca30ee04d64 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Handle WINDOWS_SDK_VERSION and simplificationsAlexandru Croitor2019-09-271-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | pro2cmake: Handle one more hardcoded condition CONFIG(osx)Alexandru Croitor2019-09-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix run_pro2cmake only_qtbase_main_modules optionAlexandru Croitor2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | cmake: Add BlueZ to the list of libraries used by Qt (connectivity)Oliver Wolff2019-09-251-0/+1
| | | | | | | | | | | | | | Task-number: QTBUG-78181 Change-Id: I4eda42c4e42ccb28ebb64eb060d02a33c3af6b03 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* | CMake: Add missing library-mappings for QtWaylandJohan Klokkhammer Helsing2019-09-251-0/+6
| | | | | | | | | | | | | | | | | | | | 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>
* | pro2cmake: Do not error out if $$files is called with a 2nd parameterJoerg Bornemann2019-09-241-4/+0
| | | | | | | | | | | | | | | | | | | | 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
* | Add SKIP_TYPE_REGISTRATION option to add_qml_moduleLeander Beernaert2019-09-241-0/+4
| | | | | | | | | | | | | | | | | | | | 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
* | pro2cmake: Fix call of write_statecharts for examplesJoerg Bornemann2019-09-241-1/+1
| | | | | | | | | | Change-Id: I5417a20deda07b96499ac4f2707e7234b0f4eb7b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | pro2cmake: Don't generate GUI applications for config.testsAlexandru Croitor2019-09-241-6/+0
| | | | | | | | | | | | | | | | | | | | 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>
* | configurejson2cmake: Generate label for out-of-line testsAlexandru Croitor2019-09-241-0/+1
| | | | | | | | | | | | Change-Id: Iaaf8d2f19269043dfad34d4ec32ec8163e9616e4 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | pro2cmake: Skip requires "skip build" message for subdir projectsAlexandru Croitor2019-09-241-1/+1
| | | | | | | | | | | | | | | | It makes too much noise when configuring. Change-Id: I0a65cb99d0dc9a6c0d288cf548035cca1bea57bc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot