Skip to content
Permalink
Browse files

Use new designer plugin ecm macro

  • Loading branch information
Montel committed Aug 12, 2019
1 parent 0d923de commit 85ab9eb53e7d2a759611703bab063cc692800451
Showing with 73 additions and 23 deletions.
  1. +9 −3 CMakeLists.txt
  2. +64 −20 src/widgets/CMakeLists.txt
@@ -74,15 +74,21 @@ find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED)

find_package(Qt5Designer NO_MODULE)
set_package_properties(Qt5Designer PROPERTIES
PURPOSE "Required to build the Qt Designer plugins"
TYPE OPTIONAL
)

find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL)
set(USE_NEW_DESIGNERPLUGIN_MACRO false)
if (ECM_VERSION VERSION_GREATER "5.61.0")
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
set(USE_NEW_DESIGNERPLUGIN_MACRO true)
else()
find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL)
endif()

set(Boost_MINIMUM_VERSION "1.34.0")
find_package(Boost ${Boost_MINIMUM_VERSION})
@@ -140,28 +140,72 @@ install(FILES

######### Build and install QtDesigner plugin #############

if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(akonadiwidgets akonadi.widgets)
target_link_libraries(akonadiwidgets
if (USE_NEW_DESIGNERPLUGIN_MACRO)
include(ECMAddQtDesignerPlugin)
ecm_qtdesignerplugin_widget(Akonadi::AgentInstanceWidget
INCLUDE_FILE "agentinstancewidget.h"
TOOLTIP "Akonadi Agent Instance Settings (Akonadi)"
WHATSTHIS "A widget to configure akonadi instance."
GROUP "Input (KDE-PIM)"
)
ecm_qtdesignerplugin_widget(Akonadi::EntityTreeView
INCLUDE_FILE "entitytreeview.h"
TOOLTIP "A view to show an item/collection tree provided by an EntityTreeModel (Akonadi)"
WHATSTHIS "A view to show an item/collection tree provided by an EntityTreeModel."
GROUP "Input (KDE-PIM)"
)
ecm_qtdesignerplugin_widget(Akonadi::TagSelectWidget
INCLUDE_FILE "tagselectwidget.h"
TOOLTIP "A Widget to select tag (Akonadi)"
WHATSTHIS "A Widget to select tag."
GROUP "Input (KDE-PIM)"
)
ecm_qtdesignerplugin_widget(Akonadi::ManageAccountWidget
INCLUDE_FILE "manageaccountwidget.h"
TOOLTIP "A Widget to Manage Akonadi Account (KDE-PIM)"
WHATSTHIS "A Widget to Manage Akonadi Account."
GROUP "Input (KDE-PIM)"
)

ecm_add_qtdesignerplugin(akonadiwidgets
NAME AkonadiWidgets
OUTPUT_NAME akonadiwidgets
WIDGETS
Akonadi::AgentInstanceWidget
Akonadi::EntityTreeView
Akonadi::TagSelectWidget
Akonadi::ManageAccountWidget
LINK_LIBRARIES
KF5::AkonadiCore
KF5::AkonadiWidgets
)
set_target_properties(akonadiwidgets PROPERTIES
OUTPUT_NAME akonadi5widgets
)

if(NOT WIN32)
# Since there are no libraries provided by this module,
# there is no point including the build tree in RPath,
# and then having to edit it at install time.
set_target_properties(akonadiwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/designer"
COMPONENT Devel
)
else()

if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(akonadiwidgets akonadi.widgets)
target_link_libraries(akonadiwidgets
KF5::AkonadiCore
KF5::AkonadiWidgets
)
set_target_properties(akonadiwidgets PROPERTIES
OUTPUT_NAME akonadi5widgets
)

if(NOT WIN32)
# Since there are no libraries provided by this module,
# there is no point including the build tree in RPath,
# and then having to edit it at install time.
set_target_properties(akonadiwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
endif()

install(TARGETS
akonadiwidgets
DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/designer
)
endif()

install(TARGETS
akonadiwidgets
DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/designer
)
endif()

0 comments on commit 85ab9eb

Please sign in to comment.
You can’t perform that action at this time.