Skip to content
Snippets Groups Projects
Verified Commit 892b11c7 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

add: link all available qml modules on the system

parent 5e72dc22
No related branches found
No related tags found
1 merge request!39add: link all available qml modules on the system
Pipeline #78771 passed
...@@ -29,7 +29,6 @@ if(QT_VERSION VERSION_LESS QT_MINIMUM_VERSION) ...@@ -29,7 +29,6 @@ if(QT_VERSION VERSION_LESS QT_MINIMUM_VERSION)
endif() endif()
qt_add_executable(${PROJECT_NAME} qt_add_executable(${PROJECT_NAME}
src/importdummy_wasm.qml
src/main.cpp src/main.cpp
src/designviewer.cpp src/designviewer.h src/designviewer.cpp src/designviewer.h
) )
...@@ -60,6 +59,36 @@ set_target_properties(${PROJECT_NAME} PROPERTIES ...@@ -60,6 +59,36 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
qt6_import_qml_plugins(${PROJECT_NAME}) qt6_import_qml_plugins(${PROJECT_NAME})
# Get all imported targets.
get_property(imported_targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY IMPORTED_TARGETS)
foreach(imported_target IN LISTS imported_targets)
# Get all qml module targets, they would have the _qt_qml_module_installed_plugin_target
# property set.
get_target_property(qml_plugin_target "${imported_target}" _qt_qml_module_installed_plugin_target)
if(qml_plugin_target)
# list of conflicting targets
# Graphs X Charts
# Graphs X DataVisualizationQml
# lottieqtplugin X libQt6Bodymovin
# QuickVectorImage X QuickVectorImageGenerator
# Charts and QuickVectorImageGenerator cannot found in the imported targets
# so the counterparts are skipped instead (Graphs and QuickVectorImage)
set(targets_to_skip "Qt6::Graphs;Qt6::lottieqtplugin;Qt6::QuickVectorImage")
if(imported_target IN_LIST targets_to_skip)
message(STATUS "Skipping target: ${imported_target} -> ${qml_plugin_target}")
continue()
endif()
message(STATUS "Imported target: ${imported_target} -> ${qml_plugin_target}")
get_target_property(module_plugin_target_type "${qml_plugin_target}" TYPE)
# Get only those qml plugins that are static libraries, and link them to the app.
if(module_plugin_target_type STREQUAL "STATIC_LIBRARY")
message(STATUS "Imported target: ${qml_plugin_target} linked")
target_link_libraries(qtdesignviewer PRIVATE "${qml_plugin_target}")
endif()
endif()
endforeach()
# BEGIN --install configuration # BEGIN --install configuration
install( install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.html FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.html
......
// Hack to force the qml plugins to be linked statically
import QtQuick
import QtQuick.Controls
import QtQml
import QtQml.Models
import QtQml.StateMachine
import QtQuick3D
import QtQuick3D.AssetUtils
import QtQuick3D.Effects
import QtQuick3D.Helpers
import QtQuick3D.ParticleEffects
import QtQuick3D.Particles3D
import QtQuick.VirtualKeyboard
import QtQuick.Timeline
import QtQuick.Timeline.BlendTrees
import QtQuick.Studio.Application
import QtQuick.Studio.Components
import QtQuick.Studio.Effects
import QtQuick.Studio.EventSimulator
import QtQuick.Studio.EventSystem
import QtQuick.Studio.LogicHelper
import QtQuick.Studio.MultiText
import QtQuick.Studio.Utils
import QtQuick.Studio.DesignEffects
import QtQuickUltralite.Extras
import QtQuickUltralite.Layers
import FlowView
import Qt.labs.folderlistmodel
ApplicationWindow {
visible: true
width: 640
height: 480
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment