aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlBuildInternals.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Remove INSTALL_SOURCE_QMLTYPES warning, take 2Kai Köhne2022-03-161-4/+0
| | | | | | | | | | Amends e1affd04e4672116f04ef3269af21bc3aa27c7b0 Pick-to: 6.2 Task-number: QTBUG-99761 Change-Id: Id06dddddedbff4264430eb7fa6235c55174df389 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Remove INSTALL_SOURCE_QMLTYPES warningAlexandru Croitor2022-03-021-4/+0
| | | | | | | | | | Remaining qml modules that need to be ported to use the new declarative registration are tracked in the linked issue. Pick-to: 6.2 Task-number: QTBUG-99761 Change-Id: I3c8fd9968ebfea10a7277082c34f77b70eede816 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltc: Rename CMake command's argument FILES -> QML_FILESAndrei Golubev2022-01-271-1/+1
| | | | | | | | | | This way we make it consistent with qt_add_qml_module() Fixes: QTBUG-100214 Change-Id: I9f38a8ba3dec978ccdf4ea937ff662ae2449e582 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 97123dbe6755a787e93797f717f8ebf193352b85) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Pass C++ sources to pre-created qml module targetsAlexandru Croitor2022-01-241-0/+3
| | | | | | | | | Previously they were silently discarded. Change-Id: I3ab4d050ea4649dec7e53f27c8044037bb49cddc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 65e4c76b9fa128aa372e34a3e663950636d6cdb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use qmltc compiler prototype as a fallback implementationAndrei Golubev2021-12-171-1/+1
| | | | | | | | | | | Task-number: QTBUG-91927 Task-number: QTBUG-96041 Task-number: QTBUG-84368 Change-Id: I47320b5f3ed8efff6fb234778df5fae5be5b64f2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e7ce5abf24f04d1b071343f07ca28b6a5d9ad4b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmltc: support user-specified namespaces in the generated codeAndrei Golubev2021-11-161-0/+52
| | | | | | | | | | | | | | | Already during the prototyping phase, conflicts in class names were encountered within Qt code base. Those could be avoided by namespaces. Initial qmltc logic was using meaningless "q_qmltc" namespace, so let's improve that by allowing user-specified namespaces + making Qt's own QML files (compiled to C++) being available under QT_NAMESPACE. The latter is achieved by providing (and using) the internal version of a qmltc-invoking function Task-number: QTBUG-84368 Task-number: QTBUG-96040 Change-Id: I99cdf1baba8838c093b6b469f6744869f72af093 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qt_add_qml_module: Add FOLLOW_FOREIGN_VERSIONING optionMaximilian Goldstein2021-10-291-0/+6
| | | | | | | | | | This option allows modules to follow the versioning scheme of their foreign base types when it comes to exposing revisioned properties. It is enabled it by default for our internal Qt modules. Task-number: QTBUG-91706 Change-Id: Ie2a660289d2b4c14800f3394321898eae3718425 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Use modified target name as base name for internal qml pluginsAlexandru Croitor2021-09-081-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using only the last dot component of the URI as the plugin base name causes issues when an app that uses QtQuickControls2 is macdeployqt'ed. The qqc2 impl plugins all have "impl" as the last URI component and thus they all use "impl" as the base name. macdeployqt tries to copy all of the plugins into a flattened PlugIns/quick folder, which ends up copying only one of the files. User qml plugins use the plugin target name as the plugin base name and plugin file name on-disk. There shouldn't be a reason for internal qml plugins to deviate too much from that. Adjust the internal qml plugin name to use the plugin target name with "plugin" suffixed at the end, but make sure to remove any existing "plugin" from the target name if it already exists, so we don't end up with double "plugin" in the base name. Amends a25f650c317e4886007a8beb0e9f2f7e973e6e7c Pick-to: 6.2.0 6.2 Task-number: QTBUG-95140 Task-number: QTBUG-96261 Change-Id: If6096e88bf2da3de081d68fad2e70cef5a0b18af Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow QML plugin's CMake target name to be specified for qmldir fileCraig Scott2021-08-201-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | The current code assumes that the basename of the QML plugin is the same as the CMake target it corresponds to. This won't be the case for installed Qt packages due to the installed name including a namespace. It also won't match when a Qt library infix is used. The current code works around the former by trying to heuristically work out whether a namespaced Qt target exists for the plugin. The Qt library infix is more problematic because the plugin target name won't include the infix whereas the plugin library basename will. Address both of those issues by adding an internal option INSTALLED_PLUGIN_TARGET to qt6_add_qml_module() which allows the installed target name to be provided. When included in a qmldir file, qt6_import_qml_plugin() will use that name, otherwise it will fall back to using the plugin library's basename, as per the current behavior. The option may become public in the future, but for now it is only for Qt's internal use for the 6.2 release. Fixes: QTBUG-95140 Pick-to: 6.2 Change-Id: I5a057c80b70ee802c0f0840e9eea2e579193d126 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Don't install metatypes json files for user qml modulesAlexandru Croitor2021-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't install metatypes json files for user created qml modules without allowing the project to say where they should be installed. Instead we should introduce new API to allow extracting the created json files so the user project decides where to install the files, similar how we would do it for other artifacts like the qmldir file or qmltypes file. Because it's too late to introduce such API for 6.2, disable installation of the files for user projects, but keep it for Qt provided qml modules. Once qt6_extract_metatypes in qtbase is fixed not to install the files by default, we should remove the newly introduced internal options and use a better mechanism for piping through when and where the files should be installed. Amends 1c4ba17015fe99da48ce73fab75ecc60cf9cb975 Pick-to: 6.2 Task-number: QTBUG-95845 Change-Id: Id8f6cd6d06aa58d42c72f62ef7458cfaf244b2cd Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove dead example-specific metatypes installation codeAlexandru Croitor2021-08-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | All projects (including examples) have ported away from using INSTALL_LOCATION and thus setting the QT_QML_MODULE_INSTALL_DIR property as part of the work done in 1c4ba17015fe99da48ce73fab75ecc60cf9cb975 Thus the work around to install the example metatypes files is not needed anymore. Furthermore qt6_extract_metatypes will be modified to not install json files by default anymore because the public API should not be handling that. Remove the dead code. Amends ee72ba123894bb92bcdd448d8a08eb1504d043eb Pick-to: 6.2 Task-number: QTBUG-95845 Change-Id: I0cfb4424cb79a059a2ecc337c9e4603b09154c63 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use renamed qt6_add_plugin PLUGIN_TYPE optionAlexandru Croitor2021-08-101-1/+1
| | | | | | | Task-number: QTBUG-95170 Pick-to: 6.2 Change-Id: I6126387bcfc8c93211d782edd9fc127fba88f66f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add NO_PLUGIN option to qt6_add_qml_module()Craig Scott2021-08-031-3/+6
| | | | | | | | | | | | | | | | | | | | The new option allows the caller to state more clearly that they do not want a plugin at all. Previously, the NO_CREATE_PLUGIN_TARGET option had to be given to prevent the command from trying to create a plugin target, but that option is meant for when the project will create the plugin target later. Now that the caller has a way to explicitly say they don't want a plugin, require PLUGIN_TARGET to be given if NO_CREATE_PLUGIN_TARGET is present. This forces the project to provide the name of the plugin target that they will be responsible for creating. Fixes: QTBUG-95141 Pick-to: 6.2 Change-Id: I84e036074f3e2785f17a8d33ad87ee0b7e016173 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve consistency of QML module target propertiesCraig Scott2021-08-031-1/+1
| | | | | | | | | | | Having more consistent property naming will make querying QML module information simpler (to be implemented in follow-up work). Task-number: QTBUG-95024 Pick-to: 6.2 Change-Id: I994742ebb1baab48ce31ec7a9371c9241e0847a3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add internal getter for qml_module_keywords cmake functionMichal Klocek2021-07-271-44/+57
| | | | | | | | | | | | | | | | Follow pattern from qtbase and add getter for keywords, this allows to wrap add_qml_module function and filter some options in other modules. This is currently need to fix top level builds for webengine, which are used by RTA builds. Task-number: QTBUG-95152 Task-number: QTBUG-94922 Pick-to: 6.2 Change-Id: I7d9c206e61a99154c45eb188145c2bdee6820665 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make TARGET_PATH an internal option for QML CMake commandsCraig Scott2021-07-261-6/+3
| | | | | | | | | | | | | | | | | TARGET_PATH should always be computed from the URI. In the past, there were some rare temporary cases where it was slightly different to assist with transitioning some existing QML modules. No internal uses of overriding the TARGET_PATH remain now though and user projects should always use a TARGET_PATH based on the URI. Keep the implementation in the public command in case an unexpected use case for it arises, but make it clear that it is now an internal option. Also remove it from qt_internal_add_qml_module() since we know it is not needed there now. Fixes: QTBUG-95083 Pick-to: 6.2 Change-Id: I75928fc194b5da64424ec8a838c1db4c0441edcf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Apply bitcode flags to internal qml plugin initializersAlexandru Croitor2021-07-221-0/+4
| | | | | | | | | | | | | | | | | | | All internal libraries, plugins, object libraries (resources, plugin initializers) need to be built with bitcode flags when targeting iOS. Internal here means all libraries added by qt_internal_add_X functions or associated with internal libraries. We didn't do that for qml plugin initializers, which were added not too long ago. Use the newly introduced helper function in qtbase to do so. Pick-to: 6.2 Task-number: QTBUG-95208 Change-Id: Ia005e0b2d4673b01b6c6a0f21bb75756708fed2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Change the default of OUTPUT_DIRECTORY for qt6_add_qml_module()Craig Scott2021-07-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | The new default is now controlled via a new QT_QML_OUTPUT_DIRECTORY variable. If that isn't set, the fallback assumes the source directory structure follows the URI structure and uses ${CMAKE_CURRENT_BINARY_DIR} instead. This pattern means more projects will have working import paths for qmllint and possibly other tools out of the box. There should also be fewer cases where the OUTPUT_DIRECTORY option needs to be used in calls to qt6_add_qml_module(). The QT_QML_OUTPUT_DIRECTORY variable facilitates the scenario where QML modules might be distributed across different parts of the source directory hierarchy, but once collected under a common base point defined by QT_QML_OUTPUT_DIRECTORY, they form a coherent set of QML modules whose subdirectory structure below that base point follows their TARGET_PATH. Fixes: QTBUG-94164 Fixes: QTBUG-95081 Pick-to: 6.2 Change-Id: I82864c361a2b34f7f1484cdbda0d9b64b34b9950 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Remove deprecated NO_CREATE_BACKING_TARGET optionAlexandru Croitor2021-07-011-2/+0
| | | | | | | | All repos using it have been adjusted. Pick-to: 6.2 Change-Id: I8156d94f81f0d77496d9147b8b5b373e1a897929 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Assign output targets to appropriate export setsAlexandru Croitor2021-06-251-9/+46
| | | | | | | | | | | | | | | | | | Plugin initializer targets should go to the plugin export set. The rest of the output targets (resources and qmlcache object libraries for now) should go the main backing target export set. Also generate the missing additional target info files for each export set. Pick-to: 6.2 Task-number: QTBUG-93257 Task-number: QTBUG-92933 Change-Id: I0b13a15459f3c6379bf87de1819fda97ade8c416 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Allow using an existing target as a backing targetAlexandru Croitor2021-06-181-5/+3
| | | | | | | | | | | | | | | | | | | This was previously achieved by passing a NO_CREATE_BACKING_TARGET internal option to qt_internal_add_qml_module. Now it's just a conditional check to only create the backing target if it doesn't exist yet. This aligns with the behavior of the public qt_add_qml_module function. The old option is deprecated and will be removed once all repos mentioning it don't use it anymore. Amends cb293ee3afea3fe0cfabee58b4d34c278f17b709 Pick-to: 6.2 Change-Id: Ifd478a5495b36c7ba127d4b8bea2ec1225035744 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Adjust QML plugin class name auto-computingAlexandru Croitor2021-06-181-6/+8
| | | | | | | | | | | | | | | | | | | | | | The recent 602d26c38f3767be9bec25302c93fc155c4dce59 change in qtbase is now requiring that CLASS_NAME is always set for qml plugins, to ensure that in static builds we can pre-build a plugin initializer object library. Split out the uri escaping and class name generation code into separate functions. Ensure that the class name is auto-generated by qt_internal_add_qml_plugin if it wasn't manually specified. Pass that value to the qt_internal_add_plugin function. Remove comment about not passing the CLASS_NAME. Task-number: QTBUG-93257 Task-number: QTBUG-92933 Change-Id: I8aa482a7da3a59f5a2213a630ff0be70506efe11 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add RESOURCES argument to qt_add_qml_moduleUlf Hermann2021-06-161-4/+5
| | | | | | | | | | | This way you can pass QML-related resources without triggering a warning. Pick-to: 6.2 Change-Id: I4b7db5007f1f2ecf0eb556bc4e5bc67f8ac9148d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Install .qml files from source dir and honor their resource aliasCraig Scott2021-06-171-5/+17
| | | | | | | | | | | | | | | | | | | | | | | For targets that are built as part of Qt, we currently require all .qml files to be passed to qt_internal_add_qml_module(). We can use that to iterate over the set of qml files and access their source file properties at configure time. The previous approach tried to use the list obtained at generate time, but the source file properties (and therefore their resource aliases) were not accessible and the install locations assumed no resource path or alias. By installing from the source dir, we also address the dependency issue where an install wouldn't cause the build dir copies to be updated. The install target will always install the latest source files with this change. Fixes: QTBUG-94519 Fixes: QTBUG-94520 Pick-to: 6.2 Change-Id: I6a97a9631ff77c3f7696899a347b83c2eb4b0ca4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Remove compatibility functionsAlexandru Croitor2021-06-161-11/+0
| | | | | | | | | | | | | | | | All our qt5.git repos are marked with QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS There are still some marketplace repos like quicktreeview that don't have it, but those should be fixed separately. The point is we don't want to override the public qt_add_qml_module function with the compatibility one. Pick-to: 6.2 Change-Id: I7959025acbf30ac94b6c20799089996a66c06fc2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Allow using existing backing target for a new qml moduleAlexandru Croitor2021-06-041-19/+34
| | | | | | | | | | | | | | | | | | qtwayland has a case where the backing target is always created by qt_internal_add_module and it is promoted to a qml module conditionally only if Qt::Qml target exists. qt_internal_add_qml_module always tries to create a backing target. Allow passing an internal only NO_CREATE_BACKING_TARGET option to re-use an existing target, while still applying necessary qml-specific install rules. Amends 1c4ba17015fe99da48ce73fab75ecc60cf9cb975 Task-number: QTBUG-91621 Change-Id: I15f4da4fd3a3ab991c78e8c77975677a0d820fd5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Refactor and update qml CMake APICraig Scott2021-06-041-65/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing CMake API for qml modules had a number of shortcomings. Refactor it to achieve the following: - Clearly separate public and internal aspects. - Re-use code from qtbase for adding plugins and module targets rather than reimplementing close variations. - Provide more robust and complete support for qmllint, qmlcachegen and automatic generation of qmldir files. - Reduce the steps needed for more common scenarios. - Encourage the use of separate backing library and plugin targets. - Automatically generate the plugin class .cpp file where possible. - Specify .qml files directly through qml-specific API elements rather than assuming they can be extracted out of a set of resources. [ChangeLog][QtQml] The qml CMake API has changed from 6.1 and is now out of Technical Preview status. The most notable change is that .qml files should no longer be specified as resources, there is dedicated handling for them in the qt6_add_qml_module(). A related change is that the qt6_target_qml_files() command has been replaced by qt6_target_qml_sources(). More complete integration with qmlcachegen, qmllint and qmldir generation is also part of the CMake API. Fixes: QTBUG-91621 Task-number: QTBUG-82598 Task-number: QTBUG-88763 Task-number: QTBUG-89274 Task-number: QTBUG-91444 Change-Id: I25aae1b0e89890394dfe2ba2824008164b2ca8d9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use CLASS_NAME rather than CLASSNAME for qt6_add_qml_module()Craig Scott2021-03-311-6/+11
| | | | | | | Task-number: QTBUG-88763 Change-Id: I118227ec418ac59eb6603d236b38b1a4319a51c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Account for qtbase refactoring in qt_internal_add_plugin()Craig Scott2021-03-311-15/+44
| | | | | | | | | Task-number: QTBUG-88763 Pick-to: 6.1 Change-Id: I66c22f876be66ca64cd364f574a6f3e862e4abf5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* CMake: Fix argument handling in qt_internal_add_qml_module() and friendsCraig Scott2021-03-101-113/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | If OUTPUT_DIRECTORY is set, all the QML files, as well as the qmldir and the plugin should end up in that directory. We should not confuse that with the install directory, which is separate. For qt_internal_add_qml_module(), we can provide the defaults for both OUTPUT_DIRECTORY and INSTALL_DIRECTORY. For the latter, don't support a separate INSTALL_LOCATION keyword, only use INSTALL_DIRECTORY. With these changes, qtbase no longer has to contain qml-specific logic for these paths in QtPluginHelpers.cmake. Refactor the way arguments are collected and passed through to the internal call to qt6_add_qml_module(). This simplifies the code and also exposed that QML_FILES was not being identified as an allowed argument, TYPEINFO was the wrong type of argument and DO_NOT_INSTALL was not a valid argument (or at least was ignored). The qt_internal_add_module() function was also duplicating logic that was largely already implemented by qt6_add_qml_module(). Rework things a little to remove that duplication. Task-number: QTBUG-88763 Pick-to: 6.1 Change-Id: I629ff63a9f8302c79694970f7b8e664a2b5d587b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Remove INSTALL_QML_FILES optionUlf Hermann2021-03-021-8/+0
| | | | | | | | | | | | QML files shall always be installed together with the module. Not installing them will just cause confusion. Pick-to: 6.1 Change-Id: I380b03f1cfce92f2c1fd1e0205e0fa307b385097 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix the argument removal in qt_internal_add_qml_moduleUlf Hermann2021-02-281-1/+3
| | | | | | | | We need to remove all the QML-specific arguments. Pick-to: 6.1 Change-Id: I99a1712251c5cf9cb6dfe399a2f1177d435a2af7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow building pure QML modules not backed by C++ sourcesAlexandru Croitor2020-11-121-16/+18
| | | | | | | | | | | | | | | | 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>
* qmltyperegistrar: Add past-major-version optionMaximilian Goldstein2020-11-101-0/+2
| | | | | | | | Adds the option to specify past major versions of modules to be registered. This is necessary for modules that don't export any types themselves to work when built statically. Change-Id: I4b4a379f92707ec64cbb32f91db9d010440b95a2 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
* CMake: Clean up logic to prepare building pure QML modulesUlf Hermann2020-11-061-2/+12
| | | | | | | | | | | | | | Make sure we don't create bogus typeinfo entries, do create a target if there are no C++ files, and do install created targets. This way we do build the qmlcachegen-created files and link them into a library which is subsequently deployed. It's not a real plugin, though, and we need to specially handle this in QML. That's material for a separate change. Change-Id: I516d4611b6041a23489ce57df38dd83114dcc5de Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Use qt_internal_add_plugin in qt_internal_add_qml_moduleAlexandru Croitor2020-10-131-1/+1
| | | | | | | | | The implementation means to call qt_internal_add_plugin because that's the one that handles the 'QML_TARGET_PATH' option. Task-number: QTBUG-86827 Change-Id: I3289741458cb8038f576bc4b08617f42fce98710 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow optional imports in qmldir filesUlf Hermann2020-10-081-0/+2
| | | | | | | | | | This is useful for modules that select their imports at runtime using qmlRegisterModuleImport(). We can list all possible variants as optional imports so that tools can see what types might be available. Task-number: QTBUG-87130 Change-Id: I8a37bdde79aef3619fd1f05e5ea6781d521afa88 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow installation of qmltypes filesUlf Hermann2020-10-081-0/+6
| | | | | | | | This is what qmake does on install_qmltypes and we do want to install the qmltypes files of our own modules. Change-Id: Iad430aab87f21331abf332ca5c92f9d7edc47bb0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rename internal functions to contain qt_internalAlexandru Croitor2020-09-251-4/+10
| | | | | | | | | Offer compatibility wrapper functions until we update all of the Qt repos to use the new names. Task-number: QTBUG-86815 Change-Id: I834ac1d5d6549bd4e33b9916a2198a7a03c0d183 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow QML plugins to be optionalUlf Hermann2020-06-091-0/+7
| | | | | | | | | | | If a plugin does nothing but load the library that provides the types, we can skip the plugin loading by linking the library directly. State that in the qmldir file, and evaluate it when loading the module. Task-number: QTBUG-84639 Change-Id: I2097237866a50f66c55e4653ad119fe10e18a893 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QML_PLUGINDUMP_DEPENDENCIESUlf Hermann2020-05-191-3/+0
| | | | | | | It isn't used anywhere and it really shouldn't be used. Change-Id: Ia101afde63b2c651ae36d719f0ba96428f12ecc9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix typoUlf Hermann2020-05-191-1/+1
| | | | | | | The 's' is important. Change-Id: Ib3a5ed86aae8f5807902193e1051e361214ef20a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add Qt6QmlBuildInternals.cmake and qt_add_qml_module()Leander Beernaert2020-02-061-0/+174
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>