From b8f52bc922efd7f4a01b222e4fcc06524f33426a Mon Sep 17 00:00:00 2001 From: renbin Date: Mon, 17 Jun 2024 11:39:30 +0800 Subject: [PATCH 1/2] chore: [titlebar] adjust cp qml file on build Add cmake custom target, cmake can automatically copy qml files to the build path every time it builds. Log: Adjust cp qml file on build --- cmake/install_plugin_quick_module.cmake | 23 ++++++++++++++----- .../core/dfmplugin-titlebar/CMakeLists.txt | 4 ++-- .../{ => qml}/LineSearch.qml | 0 .../dfmplugin-titlebar/{ => qml}/Titlebar.qml | 0 .../core/dfmplugin-titlebar/titlebar.json | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) rename src/plugins/filemanager/core/dfmplugin-titlebar/{ => qml}/LineSearch.qml (100%) rename src/plugins/filemanager/core/dfmplugin-titlebar/{ => qml}/Titlebar.qml (100%) diff --git a/cmake/install_plugin_quick_module.cmake b/cmake/install_plugin_quick_module.cmake index 7704dbee34..e79661c5a4 100644 --- a/cmake/install_plugin_quick_module.cmake +++ b/cmake/install_plugin_quick_module.cmake @@ -1,15 +1,26 @@ -# Install all plugin qml component file to - +# Install all plugin qml component file to ${DST_PATH} function(INSTALL_PLUGIN_QUICK_MODULE DST_PATH) - file(GLOB_RECURSE QMLS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.qml") - if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + # Support relative path, work on build + file(GLOB_RECURSE QMLS + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/*.qml") set(QML_BUILD_INSTALL_PATH ${PROJECT_BINARY_DIR}/../../${PROJECT_NAME}) - EXECUTE_PROCESS(COMMAND mkdir -p ${QML_BUILD_INSTALL_PATH}) - EXECUTE_PROCESS(COMMAND cp -f ${QMLS} ${QML_BUILD_INSTALL_PATH}) + add_custom_target(${PROJECT_NAME}_QML_INSTALL ALL + COMMAND mkdir -p ${QML_BUILD_INSTALL_PATH} + COMMAND cp --parents -f ${QMLS} ${QML_BUILD_INSTALL_PATH} + COMMAND echo "Copy qml file to ${QML_BUILD_INSTALL_PATH}" + COMMENT "Run automatically for each build" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + VERBATIM + ) message("--- Copy qml file to ${QML_BUILD_INSTALL_PATH}") else() + file(GLOB_RECURSE QMLS + CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/*.qml") install(FILES ${QMLS} DESTINATION ${DST_PATH}/${PROJECT_NAME}) message("--- Copy qml file to ${DST_PATH}/${PROJECT_NAME}") endif() diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt b/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt index 8b0e940162..24835b29f8 100644 --- a/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt +++ b/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt @@ -23,14 +23,14 @@ FILE(GLOB TITLEBAR_FILES "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dpcwidget/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dpcwidget/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.json" + "${CMAKE_CURRENT_SOURCE_DIR}/*.qml" + "${CMAKE_CURRENT_SOURCE_DIR}/qml/*.qml" ) find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED) add_library(${PROJECT_NAME} SHARED ${TITLEBAR_FILES} - Titlebar.qml - LineSearch.qml ) set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../) diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/LineSearch.qml b/src/plugins/filemanager/core/dfmplugin-titlebar/qml/LineSearch.qml similarity index 100% rename from src/plugins/filemanager/core/dfmplugin-titlebar/LineSearch.qml rename to src/plugins/filemanager/core/dfmplugin-titlebar/qml/LineSearch.qml diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/Titlebar.qml b/src/plugins/filemanager/core/dfmplugin-titlebar/qml/Titlebar.qml similarity index 100% rename from src/plugins/filemanager/core/dfmplugin-titlebar/Titlebar.qml rename to src/plugins/filemanager/core/dfmplugin-titlebar/qml/Titlebar.qml diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/titlebar.json b/src/plugins/filemanager/core/dfmplugin-titlebar/titlebar.json index d6d10b3433..e54b06f8e0 100644 --- a/src/plugins/filemanager/core/dfmplugin-titlebar/titlebar.json +++ b/src/plugins/filemanager/core/dfmplugin-titlebar/titlebar.json @@ -14,7 +14,7 @@ ], "Quick" : [ { - "Url" : "Titlebar.qml", + "Url" : "qml/Titlebar.qml", "Id" : "titlebar", "Parent" : "dfmplugin-core.filewindow" } From e1d7a50cf2f0333ab994b68f96f952723f2f5e8a Mon Sep 17 00:00:00 2001 From: renbin Date: Tue, 18 Jun 2024 10:51:59 +0800 Subject: [PATCH 2/2] fix: [framework] improve appletitem management Add debugging assistance function. Fix the bug that appletitem cannot be released correctly. Log: Improve item management. --- .../lifecycle/pluginquickmetadata.h | 1 + include/dfm-gui/applet.h | 2 + include/dfm-gui/appletitem.h | 2 + include/dfm-gui/windowhandle.h | 4 +- src/dfm-base/utils/clipboard.cpp | 2 +- .../lifecycle/pluginmetaobject.cpp | 25 +++++++---- src/dfm-gui/applet.cpp | 42 ++++++++++++++----- src/dfm-gui/applet_p.h | 1 + src/dfm-gui/appletitem.cpp | 11 +++++ src/dfm-gui/appletmanager.cpp | 8 +++- src/dfm-gui/attachedproperty.cpp | 21 +--------- src/dfm-gui/windowhandle.cpp | 8 ++-- src/dfm-gui/windowmanager.cpp | 1 + .../core/dfmplugin-core/CMakeLists.txt | 11 ++--- .../core/dfmplugin-detailspace/CMakeLists.txt | 9 ++-- .../core/dfmplugin-titlebar/CMakeLists.txt | 21 ++-------- 16 files changed, 92 insertions(+), 77 deletions(-) diff --git a/include/dfm-framework/lifecycle/pluginquickmetadata.h b/include/dfm-framework/lifecycle/pluginquickmetadata.h index 6cc7d8bede..45d67b3e09 100644 --- a/include/dfm-framework/lifecycle/pluginquickmetadata.h +++ b/include/dfm-framework/lifecycle/pluginquickmetadata.h @@ -63,6 +63,7 @@ class PluginQuickMetaDataCreator final QT_BEGIN_NAMESPACE #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const DPF_NAMESPACE::PluginQuickMetaData &); +Q_CORE_EXPORT QDebug operator<<(QDebug, const DPF_NAMESPACE::PluginQuickMetaPtr &); #endif // QT_NO_DEBUG_STREAM QT_END_NAMESPACE diff --git a/include/dfm-gui/applet.h b/include/dfm-gui/applet.h index 8bc8389de0..43ed475499 100644 --- a/include/dfm-gui/applet.h +++ b/include/dfm-gui/applet.h @@ -55,6 +55,8 @@ class Applet : public QObject void setComponentUrl(const QUrl &url); Q_SIGNAL void componentUrlChanged(const QUrl &url); + void dumpAppletTree(); + protected: explicit Applet(AppletPrivate &dd, QObject *parent = nullptr); QScopedPointer dptr; diff --git a/include/dfm-gui/appletitem.h b/include/dfm-gui/appletitem.h index a58e21f3d8..f09b2d5192 100644 --- a/include/dfm-gui/appletitem.h +++ b/include/dfm-gui/appletitem.h @@ -23,6 +23,8 @@ class AppletItem : public QQuickItem Applet *applet() const; void setApplet(Applet *applet); + bool isCreateComplete() const; + Q_INVOKABLE QQuickWindow *itemWindow() const; Q_SIGNAL void itemWindowChanged(QQuickWindow *window); diff --git a/include/dfm-gui/windowhandle.h b/include/dfm-gui/windowhandle.h index 5660ce72df..d08682ceec 100644 --- a/include/dfm-gui/windowhandle.h +++ b/include/dfm-gui/windowhandle.h @@ -15,7 +15,7 @@ class QQuickWindow; DFMGUI_BEGIN_NAMESPACE class Panel; -class FileManagerWindowHandleData; +class WindowHandleData; class WindowHandle { @@ -32,7 +32,7 @@ class WindowHandle private: Q_DISABLE_COPY(WindowHandle); - QScopedPointer data; + QScopedPointer data; }; using WindowHandlePtr = QSharedPointer; diff --git a/src/dfm-base/utils/clipboard.cpp b/src/dfm-base/utils/clipboard.cpp index 701f937a5a..aff01d60d3 100644 --- a/src/dfm-base/utils/clipboard.cpp +++ b/src/dfm-base/utils/clipboard.cpp @@ -62,7 +62,7 @@ void onClipboardDataChanged() return; } const QString &data = mimeData->data(kGnomeCopyKey); - const static QRegExp regCut("cut\nfile://"), regCopy("copy\nfile://"); + const static QRegularExpression regCut("cut\nfile://"), regCopy("copy\nfile://"); if (data.contains(regCut)) { clipboardAction = ClipBoard::kCutAction; } else if (data.contains(regCopy)) { diff --git a/src/dfm-framework/lifecycle/pluginmetaobject.cpp b/src/dfm-framework/lifecycle/pluginmetaobject.cpp index bc16aff208..d2c1616d11 100644 --- a/src/dfm-framework/lifecycle/pluginmetaobject.cpp +++ b/src/dfm-framework/lifecycle/pluginmetaobject.cpp @@ -221,7 +221,20 @@ Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginMetaObjec } /*! - * \brief 重定向全局Debug打印 PluginQuickInfo 对象的函数 + * \brief operator << + * 重定向全局Debug入口函数 + * \param out + * \param pointer + * \return + */ +Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginMetaObjectPointer &pointer) +{ + out << *pointer; + return out; +} + +/*! + * \brief 重定向全局Debug打印 PluginQuickMetaData 对象的函数 */ Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginQuickMetaData &quickMeta) { @@ -237,15 +250,11 @@ Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginQuickMeta } /*! - * \brief operator << - * 重定向全局Debug入口函数 - * \param out - * \param pointer - * \return + * \brief 重定向全局Debug打印 PluginQuickMetaPtr 的函数 */ -Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginMetaObjectPointer &pointer) +Q_CORE_EXPORT QDebug operator<<(QDebug out, const DPF_NAMESPACE::PluginQuickMetaPtr &quickMetaPtr) { - out << *pointer; + out << *quickMetaPtr; return out; } diff --git a/src/dfm-gui/applet.cpp b/src/dfm-gui/applet.cpp index c6da4561a9..6eaad9801b 100644 --- a/src/dfm-gui/applet.cpp +++ b/src/dfm-gui/applet.cpp @@ -5,6 +5,7 @@ #include #include #include "applet_p.h" +#include "containment_p.h" #include @@ -19,6 +20,7 @@ AppletPrivate::~AppletPrivate() { // 释放关联的 QQuickItem if (rootObject && QJSEngine::CppOwnership == QJSEngine::objectOwnership(rootObject)) { + Q_ASSERT_X(rootObject->parent() == q_ptr, "AppletItem memory management", "Undefined behaviour, unmanaged QQuickItem"); rootObject->deleteLater(); } } @@ -34,6 +36,24 @@ void AppletPrivate::setRootObject(QObject *item) Q_EMIT q_func()->rootObjectChanged(item); } +/*! + * \brief 按层级递归打印当前 Applet 树信息 + */ +void AppletPrivate::dumpAppletTreeImpl(int level) +{ + QString indent = QString(' ').repeated(level * 4); + qCDebug(logDFMGui) << indent << metaPtr; + + if (flag.testFlag(Applet::kContainment)) { + if (auto containment = dynamic_cast(this)) { + qCDebug(logDFMGui) << indent << QStringLiteral("Applet chiledren:"); + for (Applet *child : containment->applets) { + child->dptr->dumpAppletTreeImpl(level + 1); + } + } + } +} + /*! * \class Applet * \brief 管理插件 QML 组件的最小单元,包含基础的组件信息. @@ -94,22 +114,16 @@ QObject *Applet::rootObject() const } /*! - * \brief 返回当前 Applet 的容器 Containment , 若自身是容器则会返回当前对象 - * \return 容器指针 + * \brief 返回当前 Applet 的容器 Containment , 会递归向上查找 + * \return 容器指针,若父对象没有容器,返回 nullptr */ Containment *Applet::containment() const { - Containment *contain = qobject_cast(const_cast(this)); - if (contain) { - return contain; - } - contain = nullptr; - + Containment *contain = nullptr; QObject *parent = this->parent(); while (parent) { - Containment *tmp = qobject_cast(parent); - if (tmp) { + if (Containment *tmp = qobject_cast(parent)) { contain = tmp; break; } @@ -155,4 +169,12 @@ void Applet::setComponentUrl(const QUrl &url) } } +/*! + * \brief 打印当前 Applet 树信息 + */ +void Applet::dumpAppletTree() +{ + d_func()->dumpAppletTreeImpl(); +} + DFMGUI_END_NAMESPACE diff --git a/src/dfm-gui/applet_p.h b/src/dfm-gui/applet_p.h index 6206aa09ae..73d371c7d0 100644 --- a/src/dfm-gui/applet_p.h +++ b/src/dfm-gui/applet_p.h @@ -23,6 +23,7 @@ class AppletPrivate virtual ~AppletPrivate(); void setRootObject(QObject *item); + void dumpAppletTreeImpl(int level = 0); Applet *q_ptr; QUrl currentUrl; // 当前 Applet 操作的文件 Url diff --git a/src/dfm-gui/appletitem.cpp b/src/dfm-gui/appletitem.cpp index 21010e9377..b6bbb783a3 100644 --- a/src/dfm-gui/appletitem.cpp +++ b/src/dfm-gui/appletitem.cpp @@ -38,6 +38,16 @@ void AppletItem::setApplet(Applet *applet) d_func()->applet = applet; } +/*! + * \return 返回当前 Item 是否被初始化完成,目前是对 QQuickItem::isComponentComplete + * 的封装,用于判断是否被 QQmlEngine 完成创建 + */ +bool AppletItem::isCreateComplete() const +{ + Q_D(const AppletItem); + return isComponentComplete() && d->applet; +} + /*! * \return 当前 Item 所在的顶层窗体 */ @@ -81,6 +91,7 @@ AppletItem *AppletItem::itemForApplet(Applet *applet) QObject *rootObject = engine.rootObject(); if (rootObject) { if (auto item = qobject_cast(rootObject)) { + item->setApplet(applet); applet->dptr->setRootObject(item); return item; } diff --git a/src/dfm-gui/appletmanager.cpp b/src/dfm-gui/appletmanager.cpp index e2884762ac..933bf044af 100644 --- a/src/dfm-gui/appletmanager.cpp +++ b/src/dfm-gui/appletmanager.cpp @@ -77,10 +77,14 @@ Applet *AppletManagerPrivate::createAppletFromNode(const AppletTemplateNode::Ptr } if (applet->flags().testFlag(Applet::kContainment) && !node->childNode.isEmpty()) { - Containment *cotainment = applet->containment(); + Containment *containment = qobject_cast(applet); + if (!containment) { + return nullptr; + } + for (auto childNode : std::as_const(node->childNode)) { Applet *childApplet = createAppletFromNode(childNode, nullptr); - cotainment->appendApplet(childApplet); + containment->appendApplet(childApplet); } } diff --git a/src/dfm-gui/attachedproperty.cpp b/src/dfm-gui/attachedproperty.cpp index 9ffd913c9a..b884d92230 100644 --- a/src/dfm-gui/attachedproperty.cpp +++ b/src/dfm-gui/attachedproperty.cpp @@ -24,24 +24,6 @@ AppletAttached::~AppletAttached() { } Applet *AppletAttached::qmlAttachedProperties(QObject *object) { - AppletItem *item = qobject_cast(object); - if (item) { - return item->applet(); - } - Applet *applet = qobject_cast(object); - if (applet) { - return applet; - } - - QObject *parent = object->parent(); - while (parent) { - if (auto parItem = qobject_cast(parent)) { - return parItem->applet(); - } - - parent = parent->parent(); - } - if (auto context = qmlContext(object)) { return context->contextProperty("_dfm_applet").value(); } @@ -62,7 +44,8 @@ ContainmentAttached::~ContainmentAttached() { } Containment *ContainmentAttached::qmlAttachedProperties(QObject *object) { - return qobject_cast(AppletAttached::qmlAttachedProperties(object)); + auto contain = qobject_cast(AppletAttached::qmlAttachedProperties(object)); + return contain; } DFMGUI_END_NAMESPACE diff --git a/src/dfm-gui/windowhandle.cpp b/src/dfm-gui/windowhandle.cpp index a951aa5c68..45d35aedc5 100644 --- a/src/dfm-gui/windowhandle.cpp +++ b/src/dfm-gui/windowhandle.cpp @@ -9,7 +9,7 @@ DFMGUI_BEGIN_NAMESPACE -class FileManagerWindowHandleData : public QSharedData +class WindowHandleData : public QSharedData { public: QPointer panel; @@ -22,18 +22,18 @@ class FileManagerWindowHandleData : public QSharedData * \brief 提供用于操作的窗口和Applet指针 */ WindowHandle::WindowHandle() - : data(new FileManagerWindowHandleData) + : data(new WindowHandleData) { } WindowHandle::WindowHandle(const QString &error) - : data(new FileManagerWindowHandleData) + : data(new WindowHandleData) { data->errorString = error; } WindowHandle::WindowHandle(Panel *p, QQuickWindow *w) - : data(new FileManagerWindowHandleData) + : data(new WindowHandleData) { data->panel = p; data->window = w; diff --git a/src/dfm-gui/windowmanager.cpp b/src/dfm-gui/windowmanager.cpp index 1161450500..f7cc55a390 100644 --- a/src/dfm-gui/windowmanager.cpp +++ b/src/dfm-gui/windowmanager.cpp @@ -40,6 +40,7 @@ void WindowManagerPrivate::asyncLoadQuickItem(Applet *applet) tmpEngine->completeCreation(); QObject *rootObject = tmpEngine->rootObject(); if (AppletItem *item = qobject_cast(rootObject)) { + item->setApplet(applet); applet->dptr->setRootObject(item); if (auto containment = applet->containment()) { diff --git a/src/plugins/filemanager/core/dfmplugin-core/CMakeLists.txt b/src/plugins/filemanager/core/dfmplugin-core/CMakeLists.txt index d53790df3e..40658435f2 100644 --- a/src/plugins/filemanager/core/dfmplugin-core/CMakeLists.txt +++ b/src/plugins/filemanager/core/dfmplugin-core/CMakeLists.txt @@ -4,23 +4,18 @@ project(dfmplugin-core) set(CMAKE_INCLUDE_CURRENT_DIR ON) -FILE(GLOB CORE_FILES +FILE(GLOB_RECURSE CORE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.json" - "${CMAKE_CURRENT_SOURCE_DIR}/events/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/events/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp" - ) - + "${CMAKE_CURRENT_SOURCE_DIR}/*.qml" +) find_package(Dtk6 COMPONENTS Widget REQUIRED) add_library(${PROJECT_NAME} SHARED ${CORE_FILES} - FileWindow.qml ) set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../) diff --git a/src/plugins/filemanager/core/dfmplugin-detailspace/CMakeLists.txt b/src/plugins/filemanager/core/dfmplugin-detailspace/CMakeLists.txt index 17361b8fa2..1e26c01388 100644 --- a/src/plugins/filemanager/core/dfmplugin-detailspace/CMakeLists.txt +++ b/src/plugins/filemanager/core/dfmplugin-detailspace/CMakeLists.txt @@ -4,21 +4,18 @@ project(dfmplugin-detailspace) set(CMAKE_INCLUDE_CURRENT_DIR ON) -FILE(GLOB DETAILSPCE_FILES +FILE(GLOB_RECURSE DETAILSPCE_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" - - "${CMAKE_CURRENT_SOURCE_DIR}/*/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/*/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.json" - ) + "${CMAKE_CURRENT_SOURCE_DIR}/*.qml" +) find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED) add_library(${PROJECT_NAME} SHARED ${DETAILSPCE_FILES} - DetailSpace.qml ) set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../) diff --git a/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt b/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt index 24835b29f8..711a2279d1 100644 --- a/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt +++ b/src/plugins/filemanager/core/dfmplugin-titlebar/CMakeLists.txt @@ -5,27 +5,13 @@ project(dfmplugin-titlebar) set(CMAKE_INCLUDE_CURRENT_DIR ON) # TODO(zhangs): remove private -FILE(GLOB TITLEBAR_FILES +file(GLOB_RECURSE TITLEBAR_FILES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/utils/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/models/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/models/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/events/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/events/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/views/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/views/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/views/private/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/views/private/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dpcwidget/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dpcwidget/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.json" "${CMAKE_CURRENT_SOURCE_DIR}/*.qml" - "${CMAKE_CURRENT_SOURCE_DIR}/qml/*.qml" - ) +) + find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED) add_library(${PROJECT_NAME} @@ -42,6 +28,7 @@ target_include_directories(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} DFM::base + DFM::gui DFM::framework ${DtkWidget_LIBRARIES} )