aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Match qmake generated resource name for qmldir filesAlexandru Croitor2020-11-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing static builds, mkspecs/qml_module.prf embeds the qmldir file and any additional foo.qml files into a generated Qt resource file. The resource name is called qmake_<qml_plugin_uri>.qrc. In turn, certain Qt modules and plugins code call Q_INIT_RESOURCE(<qml_plugin_uri>) to initialize the resources. When Qt is built with CMake there were 2 differences. Because the resource files are not compiled into the static libraries but rather passed around as object files, there is no need to call Q_INIT_RESOURCE() anymore. The second difference was that the generated resource name for resources containing the qmldir file was '<qml_plugin_uri>_qmldir'. The differences in the CMake build caused issues when linking a QtQuick3D example project with a static Qt. That happened due to the mismatch of the generated resource name in the Q_INIT_RESOURCE() call. Unfortunately these calls can't be removed during the build system transition phase because that would break qmake Qt builds. To fix this, change the name of the CMake generated resource to match the qmake name. This avoids the undefined symbol errors during linking, but is actually a no-op! That's because the global initializer in the linked resource object file will be called before the manual Q_INIT_RESOURCE() call, effectively making the latter a no-op. Note there is one more difference regarding the CMake build. The Qt CMake builds creates 2 different resource files, one for the qmldir file (inside qt6_add_qml_module) and another separate resource for qml files (inside qt6_target_qml_files). qmake in comparison creates only one resource file for both. In practice this shouldn't affect or break anything, because even if there is no explicit Q_INIT_RESOURCE() call for the qml files resource, the global initializer will still be called from the linked in object file. An issue might happen if there are qml files, but no qmldir file, because then the qmake-required Q_INIT_RESOURCE() would not be called due to the missing qmldir resource (as generated by CMake). I think such a scenario is very unlikely if not impossible. Task-number: QTBUG-88425 Change-Id: Ib12d93d0dae52785ba8182db6829f03524723ca7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Record resource object file information for static buildsAlexandru Croitor2020-11-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | After any call to qt6_add_resources we need to record info about the resource object files. These will be embedded into the appropriate prl files to ensure that any application built with qmake links in the resources (only relevant for static Qt builds). The implementation is a bit ugly, but it gets the job done for now. It checks for the existence of an internal Qt function in the public macros and calls it if it's available. That will only happen when doing Qt builds. For regular app projects the functions will not be called, but we don't generate .prl files for such projects either way. Note that this comes with the same limitation as described in the changes for fixing QTBUG-88425. Specifically, the functions will only record resource object files for targets built as part of the current CMake invocation (aka just one repo for non-top-level builds). This handles the most common issues, but is not a complete fix. Task-number: QTBUG-87702 Change-Id: If632fdf9867cec4b24b1c6136d23ee9d8b56e650 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Replace 'file' with 'configure_file' in 'qmldir' generationAlexey Edelev2020-11-181-3/+40
| | | | | | | | | | | | | | | 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>
* Do generate typeinfo qmldir entries for pure QML modulesUlf Hermann2020-11-161-3/+1
| | | | | | | | | | As we generated qmltypes files (albeit empty), we also have to advertise them in the qmldir files. Otherwise qmllint will complain, as that is a common mistake in old modules where qmldir files were written manually. Change-Id: I4c96610930d89558cd363b7f9db28ec6e21ed4d5 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow building pure QML modules not backed by C++ sourcesAlexandru Croitor2020-11-121-5/+63
| | | | | | | | | | | | | | | | 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/+20
| | | | | | | | 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-7/+16
| | | | | | | | | | | | | | 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>
* libinfix build: adjust qmldir entriesFabian Kosmale2020-11-061-2/+2
| | | | | | | Fixes: QTBUG-88209 Change-Id: Iae298355ce0b85945ea6c5c39805794f5f997845 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix singleton declaration in qt6_target_qml_targetJoerg Bornemann2020-10-201-1/+1
| | | | | | | | The declaration is to be written without the square brackets. Fixes: QTBUG-87684 Change-Id: I8fb7fb1f9204cb56d2fa1e2c10ec585ff0e2b512 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Adjust to public API renaming in qtbaseAlexandru Croitor2020-10-181-1/+1
| | | | | | Task-number: QTBUG-86827 Change-Id: Ibeae878cbd7cc43031aeb13b2c480215c849f8bc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Mark some of the public APIs as TPAlexandru Croitor2020-10-161-1/+6
| | | | | | | | | | We don't have tests for them yet. The API surface is quite big. Some options might not make sense anymore. Task-number: QTBUG-86827 Change-Id: I4aebdb2cdfa716433681d32967ab32f1c171925c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Add generated qrc files to the qmlimportscannerCristian Adam2020-10-151-1/+7
| | | | | | | | | | | | The list of generated qrc files is passed to qmlimportscanner via the -qrcFiles parameter. qt_import_qml_plugins(pointer) needs to be explicitly called in CMake unlike qmake which does the equivalent behind the scenes. Task-number: QTBUG-85994 Change-Id: Ia49a5e1fe5df11c0b3b8ff4c1765377767ca2478 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rename qt6_quick_compiler_process_resources to be internalAlexandru Croitor2020-10-131-2/+2
| | | | | | Task-number: QTBUG-86827 Change-Id: Idb9934d18dbe54baf223d30923b03becd3e53a50 Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* Allow optional imports in qmldir filesUlf Hermann2020-10-081-15/+27
| | | | | | | | | | 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/+13
| | | | | | | | 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: Add versionless functions for new public APIAlexandru Croitor2020-10-061-0/+17
| | | | | | | | | Add some missing versionless functions. Task-number: QTBUG-86827 Change-Id: I98c554429555a7692b1315658884c173129cbe81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Allow the same syntax for depends and import entries in qmldirUlf Hermann2020-10-061-9/+13
| | | | | | | | | | Our qmldir parser does the same now and we need it in order to declare auto dependencies. Task-number: QTBUG-87164 Change-Id: Ie70474e238283c2ba936aeff49fb35acfd843da6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix in-source example buildsAlexandru Croitor2020-09-171-2/+2
| | | | | | | | | | | | QT_QMLTYPES_FILENAME can contain a path including subdirectories, so before creating the marker file in the .generated subfolder, we need to recreate the whole directory structure. Amends 1d67ecd790fe08a7cea1327ee754a9b8e74d113f Change-Id: I20ad48202d4e643df1ed3b86e631abb12d179b9d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Make reconfiguration work for in-source buildsAlexandru Croitor2020-09-161-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Qml plugins can either use a plugins.qmltypes file from the source repository, or opt into generating it if the file doesn't exist. There is a use case for the file not to be generated for some Qml tests. To protect against accidentally overriding the source repo file, an error is shown if the file exists in the source directory and we also also try to generate it. With an in-source build, all plugins.qmltypes files are generated in the source directory, and this causes the above check to be triggered on reconfiguration. To avoid the false issue, create a new "${CMAKE_CURRENT_BINARY_DIR}/.generated/plugins.qmltypes" file to serve as a marker that the actual file was generated, and is not part of the source repository. If the marker file exists, don't error out. Change-Id: Ieca28b4da0251f67f8c066cbac471c8e6e955758 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use strict C++ (no GNU extensions) when compiling qml modulesAlexandru Croitor2020-08-261-0/+1
| | | | | | | | Uses the new function exposed by qtbase, to mimic CONFIG += c++_strict from qmake. Change-Id: I972cd899f8e4c7b51e792e0e20433d016d4ac4b6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Qt6QmlMacros.cmake: support multiple versions in QT_QML_SOURCE_VERSIONMitch Curtis2020-08-231-6/+9
| | | | | | Task-number: QTBUG-86174 Change-Id: Ibd3755898ac5d292ee3d5b188a5a95f7d2f627dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Adjust naming of Qt Qml plugins for AndroidAlexandru Croitor2020-08-171-0/+20
| | | | | | | | | | | | | | | | | | | | The names are identical to the qmake ones now, following the scheme that the plugin file name should contain the TARGET_PATH, aka the directory path of the plugin, encoded in the file name itself because that's how the Android Qml plugin loader expects them. A second change is needed to pass the correct library suffix as the define, so that the Qml plugin loader actually finds them. After that, the following error goes away. libemitters_x86: qrc:/particles/emitters/emitters.qml:51:1: module "QtQuick" plugin "qtquick2plugin" not found import QtQuick 2.0 Task-number: QTBUG-85399 Change-Id: I16b9f877db3e5c8266429772a44231f1a356515c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix incorrect variable name check in qt6_import_qml_pluginsAlexandru Croitor2020-08-161-1/+1
| | | | | | | | | | | | | | The function checked for Qt6_IS_SHARED_LIBS_BUILD instead of QT6_IS_SHARED_LIBS_BUILD which ended up executing qmlimportscanner in a shared build as well, thus breaking building examples in a shared build. Fix that. Amends 9a79791e7975de811102f89686a5d631eeac9d16. Task-number: QTBUG-85961 Task-number: QTBUG-85994 Change-Id: I4869aae182a5cf85fdd9fd04a41dc4c53e9157b7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Initial work on handling Qt Qml static pluginsAlexandru Croitor2020-08-131-1/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* CMake: Partially fix static qtdeclarative builds when using qmakeAlexandru Croitor2020-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | Mimics e1e2b2d8ca89bbd90afe3e884e95bc7372bd22d5 in qtbase. Moc needs to be passed the URI as an argument, so that QQmlImportsPrivate::populatePluginPairVector doesn't fail finding the statically compiled QtQuick plugin. Fixes the following error static plugin for module "QtQuick" with name "QtQuick2Plugin" has no metadata URI import QtQuick 2.0 ^ This doesn't completely fix static qtdeclarative builds though. Task-number: QTBUG-85865 Change-Id: I1b43c3cd97b35c7222e05ecf6dcbaa16050f920f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qt6QmlMacros.cmake: take the file path into consideration when copying QML filesRichard Moe Gustavsen2020-07-301-2/+6
| | | | | | | | | | | | | | | | | When a QML plugin has QML files, and those files are placed inside a directory (other than the root), qmldir will also refer to those files prefixed with that directory. Likewise, when the plugin is installed, the QML files will need to copied so that they mirror this structure. (This is also how qmake does it). This patch will implement the same logic for cmake, so that we check if the QML files are located elsewhere than the root of the project, and if so, copy them into the same location in the installation folder. Change-Id: Iaebe4144d9b10b7d4922b53c546ca2f76bc0be1e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Require bigobj support for typeregistrar filesFabian Kosmale2020-07-101-0/+2
| | | | | | | We already had this for mingw,this adds the equivalent for MSVC. Change-Id: I0febe36ca124ed62d5c4f94bdaed46cb55832525 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Discern between "auto" and versioned imports in qmldirsUlf Hermann2020-06-241-2/+20
| | | | | | | | | | | | | You can now import the latest version, a specific version, or, "auto" which is the same version as the parent module. [ChangeLog][QtQml] You can now procedurally add module imports to modules, using qmlRegisterModuleImport(). However, actual import statements in qmldir files should be preferred wherever possible. Fixes: QTBUG-84899 Change-Id: I3b32dd8b07a19d31b6538b9a6bb436840862f345 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Fix failing 32 bit debug builds on MinGWAlexandru Croitor2020-06-151-0/+8
| | | | | | | | | | | | | | | | | When doing a doing a 32 debug build, and trying to compile one of the qml type registrations files, the following error can happen as.exe: quick_qmltyperegistrations.cpp.obj: too many sections (44466) Fatal error: can't close src/quick/CMakeFiles/Quick.dir/quick_qmltyperegistrations.cpp.obj: File too big The fix is to compile these specific files with the -Wa,-mbig-obj compile flag, which uses a munged COFF format that allows more than 32k sections in one file. Task-number: QTBUG-84886 Change-Id: Ic22e0ac409af6232db83c8a4856d5d260a0e20ff Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Allow QML plugins to be optionalUlf Hermann2020-06-091-1/+12
| | | | | | | | | | | 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>
* CMake Build: Ensure right suffix and prefixes for modules / pluginsCristian Adam2020-05-291-0/+9
| | | | | | | Same procedure as Qt Base's modules / plugins. Change-Id: I0fa86c2d137ba1abdd5c156f435d078e4f56ac8d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Quote the arguments to CMD's 'set' commandMÃ¥rten Nordheim2020-05-291-1/+1
| | | | | | | This avoids issues with some special characters and spaces. Change-Id: I79e95e75a4c1f0bf554811ebd3d2636912a3858c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Warn when the qt6_add_qml_module INSTALL_PATH is missingAlexandru Croitor2020-05-291-19/+30
| | | | | | | | | | | | | | | | | | | | If a user uses the public API function to create a qml module, they should also provide the installation path for the qml files, the compiled plugin (if C++ is involved), and the other accompanying files like qmldir. The user can specify the installation path via the INSTALL_PATH option to qt6_add_qml_module. Warn the user when they haven't done so. Also because we can't really guess where to install (we don't want to install into the Qt qml install prefix and pollute the content there), make sure to not install the files somewhere randomly. Task-number: QTBUG-84403 Change-Id: I1d8e9035b07952347f5edf854bf39869d128df4e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix qt6_target_qml_files install locationAlexandru Croitor2020-05-291-1/+1
| | | | | | | | It had a typo. Task-number: QTBUG-84403 Change-Id: Icee656e48f3acfd0d8c28dc1aa0083d2b662fd48 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Workaround fix to not install example metatypes.json filesAlexandru Croitor2020-05-291-2/+12
| | | | | | | | | | | We should not pollute the Qt install prefix lib/metatypes folder with json files that were built as part of examples. Work around this, by checking if the example qml module has an install path specified, and install there instead. Task-number: QTBUG-84403 Change-Id: I55fab7f4e2b02a74e28cf343a1aeecf59201d7cc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Explicitly require install location for plugin.qmltypesAlexandru Croitor2020-05-291-29/+36
| | | | | | | | | | | | | | If a user doesn't specify an explicit installation path for the plugin.qmltypes file, warn them about it, and make sure not to try and install the file. For internal Qt modules and plugins, we always set the path via the private qt_add_qml_module api call or by specifying the installation path explicitly via the QT_QML_MODULE_INSTALL_DIR property. Task-number: QTBUG-84403 Change-Id: I587fd70f9c767ae26f5268bb8fefc7ea678e170f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove --dependencies option from qmltyperegistrarUlf Hermann2020-05-261-5/+0
| | | | | | | | | | | We don't need to list the dependencies in the qmltypes files. The information given in the qmldir file should be enough. Ultimately, we should get rid of all hidden dependencies. Task-number: QTBUG-84286 Change-Id: Iaf67d476b449215715270043591d8c4858104ea6 Reviewed-by: Christian Kamm <mail@ckamm.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix typo in qt6_qml_type_registration functionMike Krus2020-05-091-1/+1
| | | | | Change-Id: I2dfc2f7daf3bcc7203a5043fed538c8a7a5012f0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Provide equivalent of QMLTYPES_FILENAMEFabian Kosmale2020-04-301-3/+16
| | | | | Change-Id: I622c83c8ac14bb70eb09ba9d145e0e6f13510246 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Relocate quick compiler resource pass to QtDeclarativeLeander Beernaert2020-04-211-0/+133
| | | | | | | | | Relocate the function from QtBase to QtDeclarative and set the QT6_ADD_RESOURCE_DECLARATIVE_EXTENSIONS cache variable so that this function will be called by qt6_add_resource(). Change-Id: I1213dadb999a10ca7ea6b1511b3fbb6152c3f55f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix QML_MODULE_INSTALL_DIR directory for non-prefix buildsLeander Beernaert2020-04-081-0/+10
| | | | | | Change-Id: Iba763eb1bb5da2b5ec263108c9841ecd9063fbea Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle QT_QML_SKIP_QMLDIR_ENTRY propertyAlexandru Croitor2020-03-171-0/+9
| | | | | | | | | | | | | Add a new source file property QT_QML_SKIP_QMLDIR_ENTRY which tells the build system not to add the source file as an entry in the generated qmldir file. This is useful to mark a file for installation via qt6_target_qml_files without exposing it as a QML type (like a helper javascript file). Change-Id: I2aa595692bcbb65925635abc1b12519d1a45fe53 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix version handling in qt6_qml_type_registrationAlexandru Croitor2020-03-161-4/+12
| | | | | | | | | | | We passed full version strings like "6.0.0" and the old code passed "0.0" as the minor version, which is wrong. Split the string on the dot character, and extract the first and second parts to pass them along. Change-Id: I5faf89176dfd51d5048ed9234fd84b25c8b48bea Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use correct default install dir for qml filesSamuli Piippo2020-02-201-2/+2
| | | | | | | Change-Id: I26b89d0e172465de3df36ffb0b2ea92975e99a2a Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Update metatypes dependency calculationLeander Beernaert2020-02-101-52/+11
| | | | | | | | Retrieve the list of dependent metatypes.json using the new source interfaces. Change-Id: I6ab57f370864031f2dbd097f14c3ebe6e7601d61 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Do not replace PATH when running qmltyperegistrarLeander Beernaert2020-02-071-2/+7
| | | | | Change-Id: Id23574627470e1e53a71a28bbc72980aab74b54c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix plugins.qmltypes installation for non-prefix buildsLeander Beernaert2020-02-061-1/+13
| | | | | Change-Id: I80c2b0cf29a5dcb4538aeea80222e2cc120fd979 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Copy qml files for non-prefix buildsLeander Beernaert2020-02-051-1/+5
| | | | | Change-Id: Id912998aaec1807cca0ae2621d49a463ec17fe6d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Always generate plugins.qmltypesLeander Beernaert2020-02-051-1/+18
| | | | | | | | | Due to the fact that there is no consistent usage of the qmltypes generation. We always have to add an entry to the qmldir file. Change-Id: Ic0638dfcc9a41378ec63bd5a10d90a523209cdbb Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update add_custom_command and add_custom_target dependenciesLeander Beernaert2020-02-031-1/+6
| | | | | | | | | | | If we don't add the executable used by the custom_target and/or custom_command to list of the command's/target's dependencies (DEPENDS) the generated file will not update should the executable change. Change-Id: I5b33ab5aeea65daf0fb9f8802073b362d9c28742 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>