Commit Graph

10 Commits

Author SHA1 Message Date
Ulf Hermann 9ea281b3b5 Tests: Fix various CMake warnings
Add NO_GENERATE_EXTRA_QMLDIRS where applicable, make output directories
and module URIs match, and avoid setting QTP0004 to OLD since that just
generates a different warning. Also, explicitly include some .js files
in the qmldir, even if that means re-evaluation on each import.

Pick-to: 6.8
Change-Id: Ia03445ed7df85aa4d2032ba51675bab7501ad55b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-09-10 15:51:06 +02:00
Ulf Hermann 2d44365f69 CMake: Allow omitting the version of QML modules
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.

[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.

Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-27 19:16:39 +01:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Ulf Hermann 6aad465f08 Introduce a sane resource path to qt_add_qml_module
Since "/qt" is reserved, we can use "/qt/qml" as the default path for
user QML modules.

[ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to
qt_add_qml_module(). It places your QML modules in the otherwise
reserved resource directory /qt/qml. This directory is also added to the
default QML import path. By using it you don't have to specify custom
import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an
explicit RESOURCE_PREFIX will generate a warning now because such QML
modules are likely invisible in the resource file system.

Fixes: QTBUG-95145
Fixes: QTBUG-103452
Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-06-23 09:35:57 +02:00
Ulf Hermann bf38043b61 CMake: Include upper case .js and .mjs files in qmldir
You can use them as singletons.

Pick-to: 6.2 6.3
Fixes: QTBUG-100326
Change-Id: I8e07600657bd43ba8376279ffe39cfa5d3213c38
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-01 15:21:27 +01:00
Ulf Hermann 14a3b34906 Fix generation of names in qmldir files
Dots in QML module names are useless because you cannot instantiate a
component with a dot in its name. We might as well strip all the
extensions when adding components to a qmldir file. This takes care of
.ui.qml as well.

Furthermore, JavaScript files must not be listed because they cannot be
instantiated as QML components.

Change-Id: I9782420ea79fef1d5eedef97cf7a748b96ddbe2b
Pick-to: 6.2 6.2.0
Fixes: QTBUG-96301
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tapani Mattila <tapani.mattila@qt.io>
2021-09-08 22:19:44 +02:00
Alexandru Croitor 643e093a6d CMake: Use renamed qt6_add_plugin PLUGIN_TYPE option
Task-number: QTBUG-95170
Pick-to: 6.2
Change-Id: I6126387bcfc8c93211d782edd9fc127fba88f66f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-08-10 16:00:08 +02:00
Fabian Kosmale b292e11239 Fix building tst_basicapp in toplevel builds
Pick-to: 6.2
Change-Id: I9b45d59e5d90e764c78736b19598e9ffc7928d41
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-07-21 13:20:58 +02:00
Fabian Kosmale ccd3907b12 Add test for Q_IMPORT_QML_PLUGIN
The CMake API needs to be adjusted to make this more convenient, but the
test shows that the basic idea works.

Pick-to: 6.2
Change-Id: I523069f33f8e3a8418224b8872b191d4229548b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-20 10:43:56 +02:00