summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Create module tools packages (config files) automaticallyAlexandru Croitor2019-09-224-10/+9
| | | | | | | | | | | | | | | | | | | | | Previously you had to make sure to use DISABLE_TOOLS_EXPORT in an add_qt_module call if the tools are built after the module, as well as to manually call qt_export_tools after all associated tools are built. This was needlessly complex, especially for people that are porting a repo with tools for the first time. The tools package creation is now automatically done at QtPostProcess step, so there is no need to use either DISABLE_TOOLS_EXPORT or qt_export_tools() manually. DISABLE_TOOLS_EXPORT is now a no-op, and will be removed once all repos are updated not to use it. Change-Id: I965b0d3a8a0cb908afae87b047083ed7bea9f02f Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Fix default mutable arguments usageAlexandru Croitor2019-09-221-5/+17
| | | | | | Change-Id: I91f2632f46539a1e5009b598625d78f61a051588 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Small fixes and adjustments reported by flake8 and IDEAlexandru Croitor2019-09-221-11/+22
| | | | | | Change-Id: I13fd2f20414647b75c8da237857248808dddaa40 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Reformat python files using blackAlexandru Croitor2019-09-222-26/+49
| | | | | | Change-Id: I0cc8ed89e2057b65f4fa34294eccffae642f2c73 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Handle generation of config.testsAlexandru Croitor2019-09-221-1/+122
| | | | | | | | | | | | | | | | | | | | | Handle conversion of config.tests that are used as out-of-line tests in configure.json. The script should able to handle conversion of simple config tests including nested scopes. One thing that will probably be needed in the future is handling of pkconfig which is used in qtwebengine config.tests. There is also a hardcoded list of config tests which should not be automatically converted by pro2cmake, either because they were hand written, or because it doesn't make sense to convert them for now. Incidentally, we should fix example conversion to also handle nested scopes, similarly to how it's done for config.tests. Change-Id: I862e67c4d19d5ed8cb7fc7c9f9aaf6e3d503aa03 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* configurejson2cmake: handle out-of-line config testsAlexandru Croitor2019-09-222-18/+34
| | | | | | | | | | | | | | Generate appropriate qt_config_compile_test() calls for config tests that have CMake projects. These are protected by an if(EXISTS) check so that configuration doesn't fail for repos where the config tests have not been ported yet. Adjust the qt_config_compile_test() function to use try_compile for projects specified via new PROJECT_PATH argument. Change-Id: I83c061e384f68688a654b782fd7a9bede282d1e3 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Skip converting projects under tests/auto/installed_cmakeAlexandru Croitor2019-09-211-0/+2
| | | | | Change-Id: Id26320fb55f7f0ae4b18726b0794a4a1f169c80f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Adapt string formatting in util/cmakeCristian Maureira-Fredes2019-09-215-123/+119
| | | | | | | | Second and final batch of changes related to string formatting styling. Change-Id: Ifc0e999ee95fe52fd076ac2f001b4a58f82ab5be Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix examples find_package calls to work in prefix buildsAlexandru Croitor2019-09-215-5/+11
| | | | | | | | | | | | | | | | | | | To build examples as part of a non-installed Qt prefix build, not-yet-installed Config files need to be found by find_package() calls inside example projects. Facilitate that by propagating the CMAKE_PREFIX_PATH and QT_EXAMPLES_CMAKE_PREFIX_PATH paths in all relevant find_package() calls where NO_DEFAULT_PATH is used. Also adjust the inclusion of the QtFeature.cmake file to be relative to the qt6 directory, rather than the current list directory. This is needed to successfully find the file when parsing a Config file from a non-installed build directory. Change-Id: I36031279628f1f7741d8f4d7571484a6545227f7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Let pro2cmake use private statechart API for non-examplesJoerg Bornemann2019-09-201-2/+5
| | | | | Change-Id: If6206f2377e90ba7f8502029a1cc74856a2e03a1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for requires() statements in top-level .pro filesSimon Hausmann2019-09-201-2/+29
| | | | | | | | | | | | | | | | | | | | | For example qtserialport has requires(!winrt) and with this patch it gets translated to project(...) if(WINRT) return() endif() find_package(...) qt_build_repo(...) Change-Id: Ic38b803b464037a42adc55930947f57c5efa7b45 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add platform mapping for emscriptenSimon Hausmann2019-09-201-0/+1
| | | | | | | | EMSCRIPTEN is the name in cmake land as per emscripten's toolchain file. Change-Id: I11fa444204003f25f14fbf993ecf6766bf37d884 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* cmake: Init uic only if Qt::Widgets is a targetJoerg Bornemann2019-09-201-1/+4
| | | | | | | | | | Otherwise we get errors like the following in non-gui projects: Error evaluating generator expression: $<TARGET_FILE:Qt6::uic> No target "Qt6::uic" Change-Id: I8a3a6f8ec5e5c1c3d1f73369c5739a321c64bfbb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* configurejson2cmake: Add special case handling for Windows BT config testsOliver Wolff2019-09-201-0/+5
| | | | | | Change-Id: Id73c44f5b7faff7392e7a8245e5e26e7dfe78cd8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* pro2cmake: Translate STATECHARTS to qt6_add_statechartsJoerg Bornemann2019-09-201-0/+13
| | | | | Change-Id: I461768e67ce8fa7dae70a057df340e9c9a2bc14e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Support passing extra arguments to rccJoerg Bornemann2019-09-201-3/+8
| | | | | | | | | | | qt6_add_resources already supported the OPTIONS multi value parameter, but only for the non-target case. Use the same parameter for the target case. Change-Id: Ib5fcb976ecbac244c3b11073b3cdd0c5c6366a87 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot
* CMake: pro2cmake: Do not mis-report used values as ignoredTobias Hunger2019-09-201-0/+4
| | | | | | | | | | Do not mis-report "PLUGIN_TYPE", "PLUGIN_CLASS_NAME", "CLASS_NAME" and "MODULE_PLUGIN_TYPES" as ignored. The script evaluates these. Change-Id: I26546a7eff61a20afe68168a865fe3ac99f66319 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* CMake: pro2cmake: Handle OBJECTIVE_HEADERSTobias Hunger2019-09-201-1/+1
| | | | | Change-Id: I9a7b9c96530e8c922cf4aa5b6580e5579829db87 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Extend globbing support in resourcesLeander Beernaert2019-09-201-16/+28
| | | | | | | | | | Extend globbing support in resource in order to be able to handle globbing expression present in qmake expression such as RESOURCE.files = *.qml Change-Id: I55a38c0bdc231a6a1ddbd65be7f57ca6f7dc2932 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* CMake: Use FindWaylandScanner.cmake from extra-cmake-modulesJohan Klokkhammer Helsing2019-09-202-0/+169
| | | | | | | | Change-Id: Iaf78f215396671fc6f351ac20e686cfd2c39664f Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: skip tuple declaration on condition strCristián Maureira-Fredes2019-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | In some cases after cleaning and simplifying the conditions you can end up with the following line: ((())) Python interprets that as an empty tuple: >>> a = ((())) >>> a () and then the simplify_condition (sympy) method fails to continue with an error: File ".../util/cmake/pro2cmake.py", line 1993, in simplify_condition condition_expr = simplify_logic(condition) File ".../sympy/logic/boolalg.py", line 2292, in simplify_logic expr = expr.xreplace(dict(zip(variables, s))) AttributeError: 'tuple' object has no attribute 'xreplace' You can see this behavior with the file: qtmultimedia/tests/auto/unit/multimediaqml.pro Change-Id: Ied4285b67f1e567660be49f6610311199bc48a22 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Display message when trying out SIMD testsAlexandru Croitor2019-09-191-0/+7
| | | | | | | | | This clarifies the weird pause when configuring, right after the HAVE_reduce_relocations test. Change-Id: I0edcbbd085286c20c4eaea8d8e15a509ec93d85f Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* PCH: Only enable automatically for libraries/modulesMårten Nordheim2019-09-191-1/+11
| | | | | | | | | | | Some tests are changing headers using defines inside the tests. Let's more closely mirror what qmake does to fix this. And it will also save quite a lot of space since most tests don't include all of e.g. QtCore Change-Id: I6f7e530f922418944d690bd2a1ee5f459ba755e1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Re-add dependencies.yaml so repos outside qt5 can be built with CoinAlexandru Croitor2019-09-191-0/+1
| | | | | | | Change-Id: I732f4f7520e49ec0cca8a497638fa389fc7bc032 (cherry picked from commit 575aa0d201e72fe3c22eefe2d360ea329491e6dd) Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix add_qt_gui_executable for non-Gui projectsJoerg Bornemann2019-09-191-1/+4
| | | | | | | ...which is needed, because pro2cmake thinks everything is a Gui project. Change-Id: Ib68f3eb0e796365e03b3805a3f742824cc263157 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Store generated resource files in hidden directoriesLeander Beernaert2019-09-191-7/+7
| | | | | | | | | | Store generated qrc, cpp and qmlcachegen file from invocations of add_qt_resource/qt6_add_resources/qt6_process_resources under .rcc in the target's binary directory. Change-Id: I844f97acfabe6b54db85e7a7a0c9c25694452bd3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* pro2cmake: exclude 3rdparty libs from examplesCristián Maureira-Fredes2019-09-191-2/+5
| | | | | | | | | | | There are some libraries inside examples that cannot be properly translated due to the fact that the is_example variable is True. This condition excludes it, for example: qtmultimedia/examples/multimedia/spectrum/3rdparty/fftreal/ Change-Id: I68a1e7d1684ab4604f54b6d16bf88d04e3214ba9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix formatting for test dataLeander Beernaert2019-09-191-2/+2
| | | | | | | Add missing f parameter and globbing expression. Change-Id: I0eedb59e47537f9cf42a0b9d9471ddfc87ee48f2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* cmake: Add scxml to the library mappingJoerg Bornemann2019-09-191-0/+1
| | | | | | Change-Id: I86653af25fbbc2d269eb439ceefaa2f4d4ebde28 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Add Qml plugin example supportLeander Beernaert2019-09-192-83/+289
| | | | | | | | | | | Extend the example writing section to handle qml plugins. Detection is based on whether the plugin config is detected an the target links against Qml. add_qt_qml_module() now uses the the public facing API underneath. Change-Id: I2ccd06548e7b5b18c9dc3338b835bc115fa97809 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix casing of public API functionsSimon Hausmann2019-09-192-14/+14
| | | | | | | | | Use lower case for the function name as that's cmake style. Change-Id: I6c53166aa3a8cece4abe8a485e06bd359fc12a06 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix add_qt_docs callsSimon Hausmann2019-09-1913-13/+13
| | | | | | | | Brown paper bag for me, don't use a comma to separate parameters when calling a function. Change-Id: I21e16142fab4fd1c2714df13cd6a892b036e899a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add SDL2 to 3rd-party library mappingMårten Nordheim2019-09-181-0/+1
| | | | | | Change-Id: I9f9df259340271b22a75ddfa6112ecba0f25bbbf Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Check if Qt source dir is not empty to use syncqtCristián Maureira-Fredes2019-09-181-1/+1
| | | | | | | | | In an extreme case where /bin/syncqt.pl does exists, is better to check if the QtBase_SOURCE_DIR is not empty to avoid a mismatch script version that is being used. Change-Id: Ia5694eadc5517998b827eccf70bdf6f3c14ebfa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix QtDeclcarative static buildsLeander Beernaert2019-09-182-7/+5
| | | | | | | | Incorrect variable name was being used to set the target in the parent scope. Change-Id: I73ea644ebf94c9b9a62b34b1ad493e488729ff2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Handle qmake env variables in file pathsAlexandru Croitor2019-09-181-2/+19
| | | | | | | | | | | | | | | | | | Replace things like $$(FOO) to $ENV{FOO}. This is needed to stop the script from crashing when it sees $$(FOO) in a .pro file, like in qtmultimedia/src/plugins/directshow/directshow.pro A better approach in the future will be to write a Find module that uses the env var to find the relevant headers, and then instead use a CMake cache variable, to make the build more robust in case the env var is removed after first configuring the project. Change-Id: Ia5b3dc3a90e1d4159a8b90acdade85f34b5165f9 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Add option to generate pro2cmake on failed onesCristian Maureira-Fredes2019-09-181-0/+11
| | | | | | | | The option --only-missing was added to check only the cases where there is a pro file and not a CMakeLists.txt Change-Id: Ifc6233552757e0afe8e7242a79f958e8bc77f823 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix indentation inside group_and_print_sub_dirsCristián Maureira-Fredes2019-09-181-9/+2
| | | | | | Change-Id: I34a737ae4914795f96900f2b72d0d15a3f5652d5 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve styling of util/cmake scriptsCristian Maureira-Fredes2019-09-1810-2048/+2752
| | | | | | | | | | | | | | | | | | | | | | flake8 was used to evaluate the file, with a couple of exeptions: E501,E266,W503 black was used to reformat the code automatically The changes were: * Added a README that explains how to use pipenv and pip, * Remove unnecessary return statements, * Remove '\' from the end of the lines, * Use f-strings (>= 3.6) since we are requiring Python 3.7, * Commenting unused variables, * Adding assert when Python >= 3.7 is not being used, * Wrapping long lines to 100 (Qt Style), * Re-factoring some lines, * Re-ordering imports, * Naming `except` for sympy (SympifyError, TypeError) Change-Id: Ie05f754e7d8ee4bf427117c58e0eb1b903202933 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't create "gui" applications when linking against testlibSimon Hausmann2019-09-181-1/+2
| | | | | | | | | | | | | | In qmake land, testlib.pro has "console" in MODULE_CONFIG, so linking against testlib implicies CONFIG += console. The need for a console app is typically also covered by other cases, except in qtdeclarative's qqmldebugjsserver binary (and some others). They are not test helper binaries, they are not Qt tests themselves, but they must be console apps and due to their QT += testlib in the .pro they become console apps. So with cmake they also must be console apps so that the unit tests that launch them and read their stdout can pass. Change-Id: I687fdc910b550051750be74ecd176dd96626675c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Re-generate main module CMake filesSimon Hausmann2019-09-1817-18/+18
| | | | | | | This fixes the calls to add_qt_docs to include the target. Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix up documentation integration placeholderSimon Hausmann2019-09-182-14/+37
| | | | | | | | | | In the future need will need to continue to tie qdoc runs still to targets, just like with qmake. This change prepares us for that by ensuring that add_docs takes two parameters and that any re-generated CMakeLists.txt from now on gets it right. Change-Id: Id0256dc1e2f2f59f3b4e4ca98f0d10d025d189fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: add Qt::TextToSpeech to library mappingFrederik Gladhorn2019-09-181-0/+1
| | | | | Change-Id: Ib682dede7d8e99461b146e9ef71e6d455daa8b6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix typo in CMake Android setup instructionsFrederik Gladhorn2019-09-181-1/+1
| | | | | | Change-Id: I793283080dbd8e208c136e368036721a00e9fee2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* CMake: add library mapping for QtSpeechFrederik Gladhorn2019-09-181-0/+3
| | | | | | Change-Id: I274e7382b1593dcb010f5f03ba0e2ccc9a37e5b8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Print build instructions when configuring qtbaseAlexandru Croitor2019-09-171-0/+25
| | | | | | | | This is similar to how we show the instructions when configuring in qmake land. Change-Id: Iabd28acc3d74fd0175eab812a412744dac89e6f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Add library mappings for qtwaylandJohan Klokkhammer Helsing2019-09-172-1/+6
| | | | | | Change-Id: I9d394229073579df104e21c539bbbb614ef8efbd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix for getting windows running testsMårten Nordheim2019-09-172-2/+12
| | | | | | | | | | | | | | | | | By adding the path to the DLLs early on in the path. This fixes the issue seen in CI (0xc0000135, DLL not found) and resolves local issues where you might have forgotten to add this to path yourself potentially grabbing libraries from elsewhere. The ${path} seems to be a holdover that is no longer used, so it was removed while the code was changed anyway. Also disable WIN32_EXECUTABLE for all tests so that we can actually get some output from them :) Change-Id: Iec42c809c37be4f31c7f0a7af3a30c3528022dbe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Add initial support for QtKnx cmakeKarsten Heimrich2019-09-171-0/+1
| | | | | | Change-Id: I419d15ca0bb0b02e11001b75d0c612dddfa3abec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* pro2cmake: Handle nested lists in handle_function_valueAlexandru Croitor2019-09-171-1/+19
| | | | | | | | | | | | | | Needed to successfully parse qtconnectivity projects where there are expressions like: WINDOWS_SDK_VERSION = $$member($$list($$split(WINDOWS_SDK_VERSION_STRING, .)), 2) Also fix '$$member' to be handled in the function. Change-Id: I35b5cff8c39b3a35d485d1d72f5d668cccbe9b2f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot