aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-08 14:18:53 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-08 16:06:51 +0200
commite8007671d4ec6d791cb337b297f2beb7e5300929 (patch)
treeb8ad623da50116a1e2a64a7520cbffb5dba399ec
parent40993321cd67c1fe722977ed94c91cedff4bb1f8 (diff)
CMake: Allow installation of qmltypes files
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>
-rw-r--r--src/imports/folderlistmodel/CMakeLists.txt1
-rw-r--r--src/imports/labsanimation/CMakeLists.txt1
-rw-r--r--src/imports/labsmodels/CMakeLists.txt1
-rw-r--r--src/imports/layouts/CMakeLists.txt1
-rw-r--r--src/imports/localstorage/CMakeLists.txt1
-rw-r--r--src/imports/settings/CMakeLists.txt1
-rw-r--r--src/imports/sharedimage/CMakeLists.txt1
-rw-r--r--src/imports/testlib/CMakeLists.txt1
-rw-r--r--src/imports/wavefrontmesh/CMakeLists.txt1
-rw-r--r--src/qml/Qt6QmlBuildInternals.cmake6
-rw-r--r--src/qml/Qt6QmlMacros.cmake13
11 files changed, 28 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/CMakeLists.txt b/src/imports/folderlistmodel/CMakeLists.txt
index 0c431374e8..f1e543ad9f 100644
--- a/src/imports/folderlistmodel/CMakeLists.txt
+++ b/src/imports/folderlistmodel/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(qmlfolderlistmodelplugin
CLASSNAME QmlFolderListModelPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
fileinfothread.cpp fileinfothread_p.h
fileproperty_p.h
diff --git a/src/imports/labsanimation/CMakeLists.txt b/src/imports/labsanimation/CMakeLists.txt
index b1df75b946..fa460034f2 100644
--- a/src/imports/labsanimation/CMakeLists.txt
+++ b/src/imports/labsanimation/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(labsanimationplugin
CLASSNAME QtLabsAnimationPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qquickboundaryrule.cpp qquickboundaryrule_p.h
diff --git a/src/imports/labsmodels/CMakeLists.txt b/src/imports/labsmodels/CMakeLists.txt
index 164583dd1e..e859f75fa9 100644
--- a/src/imports/labsmodels/CMakeLists.txt
+++ b/src/imports/labsmodels/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(labsmodelsplugin
CLASSNAME QtQmlLabsModelsPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/layouts/CMakeLists.txt b/src/imports/layouts/CMakeLists.txt
index 445914b71e..1beb4ee126 100644
--- a/src/imports/layouts/CMakeLists.txt
+++ b/src/imports/layouts/CMakeLists.txt
@@ -11,6 +11,7 @@ qt_internal_add_qml_module(qquicklayoutsplugin
CLASSNAME QtQuickLayoutsPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qquickgridlayoutengine.cpp qquickgridlayoutengine_p.h
diff --git a/src/imports/localstorage/CMakeLists.txt b/src/imports/localstorage/CMakeLists.txt
index abbe484874..305d9ad178 100644
--- a/src/imports/localstorage/CMakeLists.txt
+++ b/src/imports/localstorage/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(qmllocalstorageplugin
CLASSNAME QQmlLocalStoragePlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qquicklocalstorage.cpp qquicklocalstorage_p.h
diff --git a/src/imports/settings/CMakeLists.txt b/src/imports/settings/CMakeLists.txt
index bb1c1aae8b..c5c76135ba 100644
--- a/src/imports/settings/CMakeLists.txt
+++ b/src/imports/settings/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(qmlsettingsplugin
CLASSNAME QmlSettingsPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qqmlsettings.cpp qqmlsettings_p.h
diff --git a/src/imports/sharedimage/CMakeLists.txt b/src/imports/sharedimage/CMakeLists.txt
index 5ec8533b23..90020be7ee 100644
--- a/src/imports/sharedimage/CMakeLists.txt
+++ b/src/imports/sharedimage/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(sharedimageplugin
CLASSNAME QtQuickSharedImagePlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qsharedimageloader.cpp qsharedimageloader_p.h
diff --git a/src/imports/testlib/CMakeLists.txt b/src/imports/testlib/CMakeLists.txt
index 27d0446405..d340823a87 100644
--- a/src/imports/testlib/CMakeLists.txt
+++ b/src/imports/testlib/CMakeLists.txt
@@ -11,6 +11,7 @@ qt_internal_add_qml_module(qmltestplugin
DEPENDENCIES
QtQuick.Window/2.0
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
main.cpp
quicktestevent.cpp quicktestevent_p.h
diff --git a/src/imports/wavefrontmesh/CMakeLists.txt b/src/imports/wavefrontmesh/CMakeLists.txt
index b6b0008fb6..85065589ec 100644
--- a/src/imports/wavefrontmesh/CMakeLists.txt
+++ b/src/imports/wavefrontmesh/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_internal_add_qml_module(qmlwavefrontmeshplugin
CLASSNAME QmlWavefrontMeshPlugin
SKIP_TYPE_REGISTRATION
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
SOURCES
plugin.cpp
qwavefrontmesh.cpp qwavefrontmesh.h
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake
index b4cce0349a..d74b1d55fe 100644
--- a/src/qml/Qt6QmlBuildInternals.cmake
+++ b/src/qml/Qt6QmlBuildInternals.cmake
@@ -23,6 +23,7 @@ function(qt_internal_add_qml_module target)
set(qml_module_optional_args
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
DESIGNER_SUPPORTED
DO_NOT_INSTALL
SKIP_TYPE_REGISTRATION
@@ -113,6 +114,10 @@ function(qt_internal_add_qml_module target)
set(generate_qmltypes_arg GENERATE_QMLTYPES)
endif()
+ if (arg_INSTALL_QMLTYPES)
+ set(install_qmltypes_arg INSTALL_QMLTYPES)
+ endif()
+
qt_path_join(qml_module_install_dir ${QT_INSTALL_DIR} "${INSTALL_QMLDIR}/${arg_TARGET_PATH}")
qt6_add_qml_module(${target}
@@ -122,6 +127,7 @@ function(qt_internal_add_qml_module target)
${plugin_optional_arg}
${classname_arg}
${generate_qmltypes_arg}
+ ${install_qmltypes_arg}
RESOURCE_PREFIX "/qt-project.org/imports"
TARGET_PATH ${arg_TARGET_PATH}
URI ${arg_URI}
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 2d3d78415f..4bd457311a 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -81,6 +81,7 @@ function(qt6_add_qml_module target)
set(args_optional
GENERATE_QMLTYPES
+ INSTALL_QMLTYPES
DESIGNER_SUPPORTED
DO_NOT_INSTALL_METADATA
SKIP_TYPE_REGISTRATION
@@ -404,6 +405,18 @@ function(qt6_add_qml_module target)
)
endif()
+ if (arg_INSTALL_QMLTYPES)
+ set_target_properties(${target} PROPERTIES QT_QML_MODULE_INSTALL_QMLTYPES TRUE)
+ if (arg_INSTALL_LOCATION)
+ get_target_property(qml_module_install_dir ${target} QT_QML_MODULE_INSTALL_DIR)
+ if (NOT qml_module_install_dir)
+ set_target_properties(${target}
+ PROPERTIES QT_QML_MODULE_INSTALL_DIR "${arg_INSTALL_LOCATION}"
+ )
+ endif()
+ endif()
+ endif()
+
# Generate meta types data
if (arg_GENERATE_QMLTYPES)
qt6_qml_type_registration(${target})