Skip to content
Permalink
Browse files

Use new designer plugin ecm macro

  • Loading branch information
Montel committed Aug 12, 2019
1 parent b0b904c commit 9acd34ae212de9878a9c11f2ff1c23b27c529df6
Showing with 75 additions and 20 deletions.
  1. +10 −2 CMakeLists.txt
  2. +65 −18 src/designer/CMakeLists.txt
@@ -62,8 +62,16 @@ find_package(KF5Sonnet ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5SyntaxHighlighting ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
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()

add_definitions(-DTRANSLATION_DOMAIN=\"libkpimtextedit\")

@@ -1,21 +1,68 @@
if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(kpimtexteditwidgets kpimtexteditwidgets.widgets)
target_link_libraries(kpimtexteditwidgets
KF5::PimTextEdit Qt5::Widgets
)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/kpimtexteditwidgetswidgets.cpp PROPERTY SKIP_AUTOMOC ON)
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(kpimtexteditwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
if (USE_NEW_DESIGNERPLUGIN_MACRO)
include(ECMAddQtDesignerPlugin)
ecm_qtdesignerplugin_widget(KPIMTextEdit::RichTextEditorWidget
INCLUDE_FILE "kpimtextedit/richtexteditorwidget.h"
TOOLTIP "A RichTextEditor (KDE-PIM)"
WHATSTHIS "A RichTextEditor."
GROUP "Input (KDE-PIM)"
)

ecm_qtdesignerplugin_widget(KPIMTextEdit::PlainTextEditorWidget
INCLUDE_FILE "kpimtextedit/plaintexteditorwidget.h"
TOOLTIP "A PlainTextEditor (KDE-PIM)"
WHATSTHIS "A PlainTextEditor."
GROUP "Input (KDE-PIM)"
)
endif()

install(TARGETS
kpimtexteditwidgets
DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/designer
)
ecm_qtdesignerplugin_widget(KPIMTextEdit::RichTextComposer
INCLUDE_FILE "kpimtextedit/richtextcomposer.h"
TOOLTIP "A RichText Composer (KDE-PIM)"
WHATSTHIS "A RichText Composer."
GROUP "Input (KDE-PIM)"
)

ecm_qtdesignerplugin_widget(KPIMTextEdit::RichTextComposerWidget
INCLUDE_FILE "kpimtextedit/richtextcomposerwidget.h"
TOOLTIP "A RichText Composer Widget(KDE-PIM)"
WHATSTHIS "A RichText Composer Widget."
GROUP "Input (KDE-PIM)"
)

ecm_add_qtdesignerplugin(kpimtexteditwidgets
NAME KPimTextEditWidgets
OUTPUT_NAME kpimtexteditwidgets
WIDGETS
KPIMTextEdit::RichTextEditorWidget
KPIMTextEdit::PlainTextEditorWidget
KPIMTextEdit::RichTextComposer
KPIMTextEdit::RichTextComposerWidget
LINK_LIBRARIES
KF5::PimTextEdit
Qt5::Widgets
INSTALL_DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/designer"
COMPONENT Devel
)

else()
if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(kpimtexteditwidgets kpimtexteditwidgets.widgets)
target_link_libraries(kpimtexteditwidgets
KF5::PimTextEdit Qt5::Widgets
)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/kpimtexteditwidgetswidgets.cpp PROPERTY SKIP_AUTOMOC ON)
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(kpimtexteditwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
endif()

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

0 comments on commit 9acd34a

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