summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* cmake: Add IOBluetooth to list of apple system frameworksOliver Wolff2019-10-011-0/+1
| | | | | | | | The framework is needed for qtconnectivity. Change-Id: I6a502564fb5543ca94ba5ae458a544286e34564c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Enchance qt_find_package with opt-in debug capabilityAlexandru Croitor2019-10-011-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes when writing a qt_find_package and configuring a project, you might get the following error from CMake: CMake Error at QtBuild.cmake (set_property) Attempt to promote imported target "WrapFreetype::WrapFreetype" to global scope (by setting IMPORTED_GLOBAL) which is not built in this directory. This means that another find_package call, found WrapFreetype in another directory scope other than the current one, and thus the found target cat not be made global. Sometimes that implies that the qt_find_package might not be needed if WrapFreeType will always be found via a transitive depdendency. By setting QT_DEBUG_QT_FIND_PACKAGE=1 on the command line, you can make qt_find_package skip all of its behavior if the package was already found and the provided targets were also found. Unfortunately this behavior can not be made the default, because there is no way to find out in what scope the package was found, and if it's legal to make the targets global. At least I haven't found a way to do that yet. Thus the opt-in QT_DEBUG_QT_FIND_PACKAGE is a means to help with debugging such cases. Change-Id: I04242ed0f2fd0a75bc199386d28a1a0bd92da41a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add a find_library entry for the GameController frameworkMårten Nordheim2019-10-011-0/+1
| | | | | | | | Needed for QtGamepad Change-Id: I50227949eb509c021ba8d9b4dbe2b36b6a6de87f Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Always append extra cmake modules to CMAKE_MODULE_PATH in Qt6ConfigAlexandru Croitor2019-10-013-20/+6
| | | | | | | | | | | | | | | | | | | | | | During a static build we need to use the find modules in 3rdparty/extra-cmake-modules/find-modules when generating a ModuleDependencies file, so that the generated find_dependency() calls succeed. This means that the files have to be shipped with Qt6 package, making them pseudo public API. There is also a need to use these files when building QtWayland. Instead of setting / unsetting CMAKE_MODULE_PATH only in module and plugin Dependencies cmake files, just set them once when finding Qt6. This will allow QtWayland and QtX11Extras to easily find the required third party packages, without having to hardcode the paths in multiple repos. Change-Id: I750d0421a269e5632afa1bb62498c2501d73cdb1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Regenerate qtbase/src projectsAlexandru Croitor2019-09-3012-54/+42
| | | | | | | | To get less diffs for next merges and pro2cmake changes. Change-Id: I7fb5ff34bb884072a9964e8e3488c69f4290fca2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add CMakeLists.txt for CoreWLANJean-Michaël Celerier2019-09-301-0/+36
| | | | | | | Change-Id: I28a066b23e89ce2d96fd6cfa935c05b70788ed7a Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> 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-305-2/+83
| | | | | | Change-Id: I126545e1da54018ce081b42a29e62ca30ee04d64 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtPostProcess: Check target link-type when collecting depsMårten Nordheim2019-09-301-4/+11
| | | | | | | | Fixes a configure issue in qtgamepad Change-Id: I8212d6d58fd2f28ae71a9559cf6544102a873718 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix libsystemd find module nameAlexandru Croitor2019-09-271-1/+1
| | | | | | | | | | | | At least on Ubuntu the name of the pkg config package is libsystemd and not systemd. This fixes libsystemd showing up as not found in the feature summary. Change-Id: I099a253026ca8096b9e2f348a5f35209d44acc6c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Qt CMake Build Bot
* Fix some find modules not setting _FOUND variableAlexandru Croitor2019-09-272-0/+6
| | | | | | | | | If the target exists or the find_package() call succeeds we still need to set _FOUND to 1. Change-Id: Ib2267c30580082dcc177ab21708a3bc5dbde974f Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Qt CMake Build Bot
* Fix qt_find_package to not show incorrect packages at features summaryAlexandru Croitor2019-09-271-0/+7
| | | | | | | | | | | | | | | | | | | | | qt_find_package usually does 2 find_package() calls, one in CONFIG mode and one in MODULE mode. If the CONFIG mode doesn't find a Config file, the package_DIR cache variable is set to NOTFOUND, and this causes the FeatureSummary at the end to show that the package was not found, even if it is found by the next MODULE mode find_package call. Make sure to unset the _DIR variable in case if the Config module call fails. This fixes XRender showing up as not found even when it's found via the FindXRender.cmake file. Change-Id: I6ce39dad9cbb11836ca71f735a3267070c75b444 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Qt CMake Build Bot
* 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>
* Include QtPlatformSupport as part of find_package(Qt6BuildInternals)Alexandru Croitor2019-09-273-12/+14
| | | | | | | | | | | This is needed because the ported over requires() clauses from qmake to CMake are executed before qt_repo_build(), which means that all the custom platform variables that we set (like LINUX, APPLE_OSX) need to be available immediately after finding BuildInternals. Change-Id: I7345b69edf72c266508846766e64f42c99862d1d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Support CMake-typical booly values for -DFEATURE_*Joerg Bornemann2019-09-261-1/+2
| | | | | | | | | | | | Allow setting feature defines to ON, YES, TRUE, Y, OFF, NO, FALSE, N and non-negative numbers like it's possible for other defines. We'll not allow IGNORE and NOTFOUND, because they're a bit strange in the context of features. Change-Id: I7f6cd6dff4c68972921b499b28916c9ad789d510 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* cmake: Fix QT_TOOL_PATH_SETUP_COMMANDJoerg Bornemann2019-09-261-1/+1
| | | | | | | | | | | | The set command looked like this: set \"PATH=...\" which was setting the environment variable \"PATH. Removing the escaped double quotes makes it actually work. Change-Id: I2c1d5d01b4415220512b005b75b7b67c695e33ae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* instructions: executeCommandArgumentSplitingBehavior when calling qt-cmakeLiang Qi2019-09-261-0/+1
| | | | | | | Change-Id: Ibe589ee181a08df9ec999c9b769fa560b2716aac Reviewed-by: Toni Saario <toni.saario@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Qt CMake Build Bot
* instructions: start to use --parallel when cmake buildLiang Qi2019-09-253-3/+3
| | | | | | Change-Id: Ia67f0f9413c2f99dbc3b7e978256c0301502ea1d 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>
* Fix GLESv2 linkage with EmscriptenSimon Hausmann2019-09-251-19/+30
| | | | | | | | | | There's no library to link against and the headers are in the system, so we can create a synthetic import library after verifying the compilation. Change-Id: I9baa32cfe06f2f48adf066d558aa69646143efd0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* 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
* Change QT_COORD_TYPE variable which was badly translated from qmakeJean-Michaël Celerier2019-09-241-1/+1
| | | | | | | | | Note that from a quick grep, nothing sets QT_COORD_TYPE in the CMake buildsystem yet, and nothing uses it either. Change-Id: I91241089ff08f6b93d1d0b00e135063cfe516dfc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix build with qmakeSimon Hausmann2019-09-241-0/+1
| | | | | | | | | Since the direct .moc inclusion was added for cmake, we need to make the _p.h visible to qmake via HEADERS so that qmake can also see this. Change-Id: I042544856fe28e46b978d3b5938fbff8614367be Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add SKIP_TYPE_REGISTRATION option to add_qml_moduleLeander Beernaert2019-09-242-0/+12
| | | | | | | | | | 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
* Add CMakeLists.txt for cocoa printsupport plug-inJean-Michaël Celerier2019-09-242-1/+26
| | | | | | | Change-Id: I0cc8b2827e0986d9ef486f327e7d84362e7d99c4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* 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>
* Print status messages when doing out-of-line config.testsAlexandru Croitor2019-09-241-0/+9
| | | | | | | | As well as SIMD tests. Change-Id: I43318418f90a6b9736eb89f008459c7d6adac8f9 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
* Fix FindEGL on EmscriptenSimon Hausmann2019-09-241-9/+17
| | | | | | | | | Fixes were upstreamed with commit 3b0bf71a72789eb2b79310b4f67602115e347f56 in extra-cmake-modules and this brings the file in sync. Change-Id: Ica3a29fd091afa669f29a3e9775e637566f1cb97 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* pro2cmake.py: generate code for WAYLAND*SOURCESJohan Klokkhammer Helsing2019-09-241-1/+31
| | | | | | | | | | WAYLANDCLIENTSOURCES and WAYLANDSERVERSOURCES is used heavily throughout QtWayland. Task-number: QTBUG-78177 Change-Id: I4507447054c435f78e82c2ca3e9404288db6c1f6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* macOS: Prevent warnings about object files without any symbolsTor Arne Vestbø2019-09-241-0/+12
| | | | | | Change-Id: I0860b95cd75f536ff20defde97c3df7dc78a1e18 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Implement the ~= operator in pro2cmakeJoerg Bornemann2019-09-231-2/+34
| | | | | | Change-Id: I3fadd0038d517d197cce898d10edd6ba452adea9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Ignore generated .qrc filesJoerg Bornemann2019-09-231-0/+3
| | | | | | | | | | | ...instead of complaining about non-existing files. qtscxml/tests/auto/scion/scion.pro has RESOURCES = $$OUT_PWD/scion.qrc Change-Id: I5737fe5078c87689152fc7fa0d8d25ddc2b1a00f Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix qtdeclarative buildAlexandru Croitor2019-09-231-4/+5
| | | | | | | | | | | | There is an issue about versionless tool target not finding the regular targets, and that fails the configuration phase of qtdeclarative. Temporarily don't export the versionless targets, to get the qt5 build going. Change-Id: I5c7baff7f677f4a3f1f91b9e8082ba8a80f9cddd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix top-level builds with qmakeSimon Hausmann2019-09-231-16/+14
| | | | | | | | | | | The separation of functionality into functions in commit 37756ede09402931758efc51072147a3ea73d961 accidentally broke top-level builds as the function to detect -top-level was operating on local parameters (shift) or they were not available ($1). Inlining these few lines fixes it. Change-Id: Icf609dc5e7b361997847f3ef3a1b10635c122d5d Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* cmake: Include repo-specific setup filesJoerg Bornemann2019-09-231-0/+10
| | | | | | | | | | | This is useful for providing private CMake API which is not part of QtBase. Also, fix the setup files to be included when building standalone tests. The old ${PROJECT_NAME}Setup.cmake file inclusion will be removed once all usages are adjusted. Prompted-by: Alexandru Croitor <alexandru.croitor@qt.io> Change-Id: I5bc2bca7371660c00b0301e94d025a29b68d6975 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Improve handling of requires clausesAlexandru Croitor2019-09-231-11/+42
| | | | | | | | | | | | | | | | | | | | | | | Change the grammar to parse and extract the whole expression that is present in the requires clause. Make sure to preprocess the parsed content as a condition, so that the value passed to map_condition and simplify_condition is valid and the functions can handle more complicated conditions like qtConfig() and if(). Wrap the final condition with an extra pair of parentheses, so that the negated condition is computed correctly. Handle the require clause in subdir projects, top level tests projects, regular test projects, as well as top level repo projects. Examples are not yet handled, because the would require some kind of CMake public api to e.g. query if a feature is enabled. Change-Id: I9af96cf022e47b66f24db3ca15d3803dda7a5d7c Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Fix regexp for parsing env var expansionAlexandru Croitor2019-09-231-1/+1
| | | | | | | | | | | | | The qmake syntax for env var expansion is "$$()". The parantheses are not optional, so the optional "?" modifiers should be removed. This fixes the failing test_recursive_expansion pytest. Amends c58df80cf7926b07da9fe6515230bd4295c1fc6d. Change-Id: I5d7217555287ee7d96d6b38027964b1141af208a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* pro2cmake: Handle if() conditions with pyparsingAlexandru Croitor2019-09-231-6/+15
| | | | | | | | | | | | | | Previously we used a regular expression that matched parentheses, but the regexp didn't match the parantheses in a balanced way if there was more than one pair. Instead use a helper function that uses pyparsing to match balanced parantheses, and removes the if keyword, leaving just the nested expression. Change-Id: Ie621e6a305e57aa411838288599366ccfba063cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* pro2cmake: Fix regressions introduced by reformat changeAlexandru Croitor2019-09-231-17/+3
| | | | | | | | | | | | | | | | | | | Sympy uses eval() inside its code, and that can raise an AttributeError exception, so we have to catch that. This happened when converting qml.pro in qtdeclarative. Also the formatting change removed the raising of an exception when an unhandled function was encountered in handle_function_value, which caused not returning any value in such a case. Instead just return the whole expression string, without checking if the function is in some whitelist. Also encountered in qml.pro. Amends 91634c3c9b8d4f68f0ebd2ac76a8b5b79e4b4c94. Change-Id: I47b73af1de0180becb9ef4fb78a8c35a04928d34 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>