Skip to content
Permalink
Browse files

Use new designer plugin ecm macro

  • Loading branch information
Montel committed Aug 12, 2019
1 parent 3526bc4 commit ef790a87298c8b8c843c09573a30c2d51cdd5885
Showing with 55 additions and 18 deletions.
  1. +10 −2 CMakeLists.txt
  2. +45 −16 src/pimcommon/designer/CMakeLists.txt
@@ -64,8 +64,16 @@ find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5Purpose ${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()

find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
@@ -1,20 +1,49 @@
if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(pimcommonwidgets pimcommon.widgets)
target_link_libraries(pimcommonwidgets
if (USE_NEW_DESIGNERPLUGIN_MACRO)
include(ECMAddQtDesignerPlugin)
ecm_qtdesignerplugin_widget(PimCommon::SimpleStringListEditor
INCLUDE_FILE "pimcommon/simplestringlisteditor.h"
TOOLTIP "A listbox with add/remove/move up/down button (KDE-PIM)"
WHATSTHIS "A listbox which lets organize list order."
GROUP "Input (KDE-PIM)"
)
ecm_qtdesignerplugin_widget(PimCommon::TranslatorWidget
INCLUDE_FILE "pimcommon/translatorwidget.h"
TOOLTIP "A widget to make translate string (KDE-PIM)"
WHATSTHIS "A widget to make translate string."
GROUP "Input (KDE-PIM)"
)

ecm_add_qtdesignerplugin(pimcommonwidgets
NAME PimCommonWidgets
OUTPUT_NAME pimcommonwidgets
WIDGETS
PimCommon::SimpleStringListEditor
PimCommon::TranslatorWidget
LINK_LIBRARIES
KF5::PimCommon KF5::PimTextEdit
)
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(pimcommonwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/designer"
COMPONENT Devel
)
endif()
else()

if (KF5DesignerPlugin_FOUND)
kf5designerplugin_add_plugin(pimcommonwidgets pimcommon.widgets)
target_link_libraries(pimcommonwidgets
KF5::PimCommon KF5::PimTextEdit
)
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(pimcommonwidgets PROPERTIES
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
endif()

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

0 comments on commit ef790a8

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