aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix qml module version to use the repo project versionAlexandru Croitor2021-04-161-1/+1
| | | | | | | | | | | | Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION, so that the repo project version is used in a top-level build, rather than the version of the qt5 project. Task-number: QTBUG-92861 Change-Id: I5a7a09baf81353558e512800746ac24e8e8b9a47 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cd7bd71d08f1c21648756d0a9fd501ce37a8cc0c) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Replace 'file' with 'configure_file' in 'qmldir' generationAlexey Edelev2020-11-181-0/+2
| | | | | | | | | | | | | | | Collect content of 'qmldir' file that is generated by 'qt6_add_qml_module' and 'qt6_target_qml_files' functions, instead of write content to file immediately. Use 'cmake_language(DEFER CALL)' to call 'configure_file' write whole 'qmldir', when finalizing CMAKE_CURRENT_SOURCE_DIR scope. This way a reconfiguration will not rewrite the files, touch the timestamps, and thus needlessly rebuild. Task-number: QTBUG-88172 Change-Id: Idca68e4ceed13d0aa7eac443e769d5677557b880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow building pure QML modules not backed by C++ sourcesAlexandru Croitor2020-11-121-0/+6
| | | | | | | | | | | | | | | | When no C++ sources are passed to qt_internal_add_qml_plugin (a pure QML module), create a C++ backed Qt plugin anyway. In such a case, generate a dummy plugin.cpp containing a QQmlEngineExtensionPlugin subclass. The class name is autogenerated from the QML import URI. The class constructor will call the qmltyperegistrar generated void qml_register_types_foo() function, to ensure the needed module versions are registered for the QML module. Change-Id: I19959dafdf0dc837c6037e7dc1d549b7420110a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-37/+37
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix what Android lib suffix should be passed as a defineAlexandru Croitor2020-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | CMAKE_SYSTEM_PROCESSOR has the value i686 when targeting the x86 Android ABI, which is set by the Android CMake toolchain. This is not the value that Qt expects, and breaks loading of Qt Qml plugins. The same with aarch64 instead of arm64-v8a. In qmake the proper values for QT_ARCH variable are the equivalent of the ANDROID_ABI variable set by the CMake toolchain file, so use ANDROID_ABI. This allows building and running a qtdeclarative example built with CMake on the x86 Android emulator. Note that the x86 emulator still fails to actually run the examples properly due to some weird atomics consistency issues, but that's a separate issue. At least it doesn't fail saying that the Qt Quick 2 plugin can not be found. Task-number: QTBUG-85399 Change-Id: Ic85c7f998b6d69793e4f7f0408fca6bdc88f6416 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Initial work on handling Qt Qml static pluginsAlexandru Croitor2020-08-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5 we added a QmlImportScanner package that provided a qt5_import_qml_plugins() function. Calling it with a target ensured running qmlimportscanner to find and link necessary qml static plugins for an application to work. This is the initial port of that to Qt 6, with a few differences. It introduces 2 function names, the version-less one and qt6_ prefixed one, qt_import_qml_plugins and qt6_import_qml_plugins. Implementation notes. In Qt 5 we figured out what link flags to pass by parsing the plugin prl files. In Qt 6, CMake can generate appropriate plugin targets with dependencies, as well as Config files that can look for the dependent packages. Use that information for finding the dependencies and linking. Note this relies on the assumption that find_package(Qt6Qml) will already include all available Qml plugin Config files, so that the targets exist in scope by the time qt_import_qml_plugins is called and links against those targets. The automatic inclusion is handled by a change in qtbase. In Qt 5 the function was available as part of QmlImportScanner package. In Qt 6 the function is moved to QmlMacros, so it's enough to find_package(Qt6Qml) to use it. A dummy QmlImportScanner package is provided for backwards compatibility, that simply finds the Qml package. Another change is to make the resource name added by qt6_target_qml_files unique (include the target name), because qmlcachegen generates a cpp file with a static initializer function name that includes the resource name. This caused duplicate symbol errors when linking more than one qtquickcontrols2 style plugin into an application when the resource name was not unique. There are a couple of TODOs left: - Figure out if it's possible to automatically call qt_import_qml_plugins for applications that link against Qml. Perhaps using our hacky scope finalizers. - Figure out how to handle scanning of resources. Task-number: QTBUG-85961 Task-number: QTBUG-85994 Change-Id: I42f61e4acc6f74a3cdc030dba9e41ce789bc28f6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove qmake wildcard in masm.priFriedemann Kleint2020-06-301-3/+38
| | | | | | | | | | It stopped working on Windows after the QRegularExpression refactoring of qmake. Change-Id: Ic91193ffe709eae36104a7ffd9c09d6b4461322f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace QQmlBoundSignalExpressionPointer with QQmlRefPointerUlf Hermann2020-06-241-2/+1
| | | | | | | They do the same thing. Change-Id: Ia35832e6175728e7480d09caba6d3833718d9e80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Deduplicate the import resolution algorithmUlf Hermann2020-06-101-0/+1
| | | | | | | We will need it in various other places, too. Change-Id: I61c55f88b66ab85448ae8fff125fe34108532fc4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Un-pimpl QQmlModuleImportUlf Hermann2020-06-101-1/+0
| | | | | | | There is no point in having that pimpl'd. Change-Id: I9e3f6671ca178ea3f58fd0488dbb291a38656685 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove winrtOliver Wolff2020-06-041-19/+10
| | | | | | | | | Task-number: QTBUG-84434 Change-Id: If8f57f00726868a3540c877d07fca761618e4f08 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Regenerate qtdeclarative/srcAlexandru Croitor2020-05-291-13/+13
| | | | | | | | | | Includes - renaming of internal plugin api call - generation of QT_QMLTYPES_FILENAME - addition of a few TARGET_DESCRIPTION Change-Id: I72b5647b8c16af9945795ead62a075322b6bb2f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix qmltypes file names for qmltypes built from librariesUlf Hermann2020-05-191-0/+1
| | | | | | | We still expect those to be called "plugins.qmltypes" in a few places. Change-Id: I751b2bb9ca264fb7998d11c2f969ee46b32fb2cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Re-arrange qv4identifier{_p.h|.cpp}Ulf Hermann2020-04-151-1/+2
| | | | | | | | | | | | QV4::IdentifierHashData doesn't need to be visible to all the clients. Furthermore, it can be completely inline. The public functions of QV4::IdentifierHash need to be out of line, but the private ones can be all inline. This shouldn't make much of a difference as most of the public functions call at least one private function. Finally, the files should be named by the class names. Change-Id: I931f2aa71103e41fdd3dae9cc47d204edece0e12 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement URL objectMaximilian Goldstein2020-04-081-0/+1
| | | | | | | | | Implements the JavaScript URL object (https://url.spec.whatwg.org/#api). Except that it does not currently implement the searchParams field. Task-number: QTBUG-54988 Change-Id: I19abc69e075cbf84bd15e6791be195ce16f3fe73 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for binding directly to QProperty instancesSimon Hausmann2020-03-301-0/+1
| | | | | | | | | | Avoid going through externally managed bindings and instead allocate a more lightweight property binding. It's basically a QQmlJavaScriptExpression and one pointer plus the overhead of QPropertyBindingPrivate. Change-Id: I1530330926d351b61f2b3bbad39301c628a8bef1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Encapsulate QV4::ResolvedTypeReferenceUlf Hermann2020-03-251-0/+1
| | | | | | | It's used all over the place. We need a proper interface. Change-Id: Iebe254ef3bf35503bf3fdd3639979a5db2b3449e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Encapsulate QQmlContextDataUlf Hermann2020-03-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is not a private detail of QQmlContext. And it is incredibly hard to see who owns what in there. Let's add some civilization ... We enforce refcounting for QQmlContextData across the code base, with two exceptions: 1. QQmlContextPrivate may or may not own its QQmlContextData. 2. We may request a QQmlContextData owned by its parent QQmlContextData. For these two cases we keep flags in QQmlContextData and when the respective field (m_parent or m_publicContext) is reset, we release() once. Furthermore, QQmlContextData and QQmlGuardedContextData are moved to their own files, in order to de-spaghettify qqmlcontext_p.h and qqmlcontext.cpp. When the QQmlEngine is deleted, any QQmlComponents drop their object creators now, in order to release any context data held by those. Before, the context data would be deleted, but the object creators would retain the dangling pointer. [ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does what the documentation says now: It prefers explicitly set baseUrls over compilation unit URLs. Only if no baseUrl is set, the CU's URL is returned. It used to prefer the CU's URL. Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-121-4/+4
| | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Regenerate qtdeclarativeAlexandru Croitor2020-02-121-1/+1
| | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add Qt6QmlBuildInternals.cmake and qt_add_qml_module()Leander Beernaert2020-02-061-0/+2
| | | | | | | | Add the qt_add_qml_module() which was originally present in QtBuild.cmake in QtBase. Change-Id: If053c0581dd14a6dcf4ef2013c9266e7dd828a76 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate projects to handle private deps correctlyAlexandru Croitor2020-02-051-0/+2
| | | | | | Change-Id: Ifcbab0407e93dfc35d0459d7d29dee2cd3508a86 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Post-merge fixesAlexandru Croitor2020-01-301-0/+1
| | | | | Change-Id: I2350df5368ee34d6c7072d456806e518ce533839 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML Type Registrar changesLeander Beernaert2020-01-241-0/+10
| | | | | Change-Id: I36254a688f575e6c7f717ee4019e4d49f73a60f7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Post merge fixesLeander Beernaert2020-01-241-16/+6
| | | | | Change-Id: Ie8aca222809f35174fb6c6488832ec3ff5432272 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Post Merge FixesLeander Beernaert2019-11-251-0/+1
| | | | | Change-Id: I13bc3aef318d8b497b01c61fcca7760abd96339a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-38/+38
| | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate projectsAlexandru Croitor2019-11-141-7/+2
| | | | | | Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix up qlalr calls in preparation for API change in qtbaseSimon Hausmann2019-10-151-1/+1
| | | | | | | The target should come first, for consistency. Change-Id: I305781c119883189852fc5299522766bed90f09b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate required projects after dev -> wip/cmake mergeAlexandru Croitor2019-10-141-2/+2
| | | | | Change-Id: Ic5f1909731ec11b4fb6bc8823506d272c529ecfb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate the necessary bits of qtdeclarative after wip/qt6 mergeAlexandru Croitor2019-10-141-4/+9
| | | | | Change-Id: If58c29baf7fa3c3591968fca6d11f7649308dbf9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate qtdeclarative before mergeAlexandru Croitor2019-10-111-12/+19
| | | | | | Change-Id: I5710110679220c4e22bc7f8b540f18a51b735ddf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-241-31/+47
| | | | Change-Id: I52b2d17d9334313e4b3d84b52432f2ebc77f7415
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-19/+14
| | | | Change-Id: I2963c1209316fb6755f572969f368970450d7991
* More porting of declarative modulesAlexandru Croitor2019-06-081-0/+2
| | | | | Change-Id: Ibe6d87998af1209518af87117b79778136110786 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix building on LinuxAlexandru Croitor2019-06-041-9/+9
| | | | | | | | | Some condition scope checks were not mapped correctly by the conversion script. Rerun the conversion after fixing them in the conversion script. Change-Id: Id8e44a207cf821cb9edb98ba83890030dd880f92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Initial CMake portAlexandru Croitor2019-06-031-0/+602
Crude port of QtQml, QtQmlModels, QtQuick and a few tests and a few examples. Task-number: QTBUG-74136 Change-Id: I5de4d8215b33d1a4a72c2c0e7951e4b384f27e3e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>