"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/cmake/modules/MacroDPlugins.cmake" (4 Sep 2019, 8064 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) CMake source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "MacroDPlugins.cmake": 6.2.0_vs_6.3.0.

    1 # Some useful macros for printing status information
    2 #
    3 # Copyright (c) 2010-2019, Gilles Caulier, <caulier dot gilles at gmail dot com>
    4 #
    5 # Redistribution and use is allowed according to the terms of the BSD license.
    6 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
    7 
    8 include(CMakeParseArguments)
    9 
   10 # -------------------------------------------------------------------------
   11 
   12 # This macro implement the rules to compile and link a Generic DPlugin with extra arguments.
   13 #
   14 # Usage: DIGIKAM_ADD_GENERIC_PLUGIN(NAME    _plugin_name_
   15 #                                   SOURCE  _plugin_sources_
   16 #                                   DEPENDS _plugin_dependencies_)
   17 #
   18 # With: _plugin_name_ the literal name of the plugin (mandatory).
   19 #       _plugin_sources_ the list of source codes to compile (mandatory).
   20 #       _plugin_dependencies_ the list of dependencies to link (optional).
   21 #
   22 # Note: by default a Generic plugin is linked with digikamcore shared library.
   23 #
   24 # This macro will generate a plugin library with this pattern as file name:
   25 # Generic_${_pluginname_}_Plugin
   26 #
   27 macro(DIGIKAM_ADD_GENERIC_PLUGIN)
   28 
   29     set(_OPTIONS_ARGS)
   30     set(_ONE_VALUE_ARGS)
   31     set(_MULTI_VALUE_ARGS NAME SOURCES DEPENDS)
   32 
   33     cmake_parse_arguments(_parse_results "${_OPTIONS_ARGS}"
   34                                          "${_ONE_VALUE_ARGS}"
   35                                          "${_MULTI_VALUE_ARGS}"
   36                                          ${ARGN}
   37     )
   38 
   39     # Mandatory
   40     if(_parse_results_NAME)
   41 #        message(STATUS "Generic plugin name=${_parse_results_NAME}")
   42     else()
   43         message(FATAL_ERROR "Generic plugin name is required.")
   44     endif()
   45 
   46     if(_parse_results_SOURCES )
   47 #        message(STATUS "Generic plugin sources=${_parse_results_SOURCES}")
   48     else()
   49         message(FATAL_ERROR "Generic plugin sources is required.")
   50     endif()
   51 
   52     # Optional
   53     if(_parse_results_DEPENDS)
   54 #        message(STATUS "Generic plugin dependencies=${_parse_results_DEPENDS}")
   55     endif()
   56 
   57     if(APPLE)
   58         set(_extra_deps /System/Library/Frameworks/AppKit.framework)
   59     endif()
   60 
   61     add_library(Generic_${_parse_results_NAME}_Plugin
   62                 MODULE ${_parse_results_SOURCES})
   63 
   64 
   65     target_link_libraries(Generic_${_parse_results_NAME}_Plugin
   66                           digikamcore
   67 
   68                           Qt5::Core
   69                           Qt5::Gui
   70                           Qt5::Xml
   71                           Qt5::XmlPatterns
   72                           Qt5::Widgets
   73 
   74                           KF5::XmlGui
   75                           KF5::I18n
   76                           KF5::ConfigCore
   77                           KF5::Service
   78 
   79                           ${_parse_results_DEPENDS}
   80                           ${_extra_deps}
   81     )
   82 
   83     install(TARGETS Generic_${_parse_results_NAME}_Plugin
   84             DESTINATION ${PLUGIN_INSTALL_DIR}/digikam/generic
   85     )
   86 
   87 endmacro()
   88 
   89 # -------------------------------------------------------------------------
   90 
   91 # This macro implement the rules to compile and link an Editor DPlugin with extra arguments.
   92 #
   93 # Usage: DIGIKAM_ADD_EDITOR_PLUGIN(NAME    _plugin_name_
   94 #                                  SOURCE  _plugin_sources_
   95 #                                  DEPENDS _plugin_dependencies_)
   96 #
   97 # With: _plugin_name_ the literal name of the plugin (mandatory).
   98 #       _plugin_sources_ the list of source codes to compile (mandatory).
   99 #       _plugin_dependencies_ the list of dependencies to link (optional).
  100 #
  101 # Note: by default an Editor plugin is linked with digikamcore shared library.
  102 #
  103 # This macro will generate a plugin library with this pattern as file name:
  104 # Editor_${_pluginname_}_Plugin
  105 #
  106 macro(DIGIKAM_ADD_EDITOR_PLUGIN)
  107 
  108     set(_OPTIONS_ARGS)
  109     set(_ONE_VALUE_ARGS)
  110     set(_MULTI_VALUE_ARGS NAME SOURCES DEPENDS)
  111 
  112     cmake_parse_arguments(_parse_results "${_OPTIONS_ARGS}"
  113                                          "${_ONE_VALUE_ARGS}"
  114                                          "${_MULTI_VALUE_ARGS}"
  115                                          ${ARGN}
  116     )
  117 
  118     # Mandatory
  119     if(_parse_results_NAME)
  120 #        message(STATUS "Editor plugin name=${_parse_results_NAME}")
  121     else()
  122         message(FATAL_ERROR "Editor plugin name is required.")
  123     endif()
  124 
  125     if(_parse_results_SOURCES )
  126 #        message(STATUS "Editor plugin sources=${_parse_results_SOURCES}")
  127     else()
  128         message(FATAL_ERROR "Editor plugin sources is required.")
  129     endif()
  130 
  131     # Optional
  132     if(_parse_results_DEPENDS)
  133 #        message(STATUS "Editor plugin dependencies=${_parse_results_DEPENDS}")
  134     endif()
  135 
  136     if(APPLE)
  137         set(_extra_deps /System/Library/Frameworks/AppKit.framework)
  138     endif()
  139 
  140     add_library(Editor_${_parse_results_NAME}_Plugin
  141                 MODULE ${_parse_results_SOURCES})
  142 
  143     target_link_libraries(Editor_${_parse_results_NAME}_Plugin
  144                           digikamcore
  145 
  146                           Qt5::Core
  147                           Qt5::Gui
  148                           Qt5::Xml
  149                           Qt5::XmlPatterns
  150                           Qt5::Widgets
  151 
  152                           KF5::XmlGui
  153                           KF5::I18n
  154                           KF5::ConfigCore
  155                           KF5::Service
  156 
  157                           ${_parse_results_DEPENDS}
  158                           ${_extra_deps}
  159     )
  160 
  161     install(TARGETS Editor_${_parse_results_NAME}_Plugin
  162             DESTINATION ${PLUGIN_INSTALL_DIR}/digikam/editor
  163     )
  164 
  165 endmacro()
  166 
  167 # -------------------------------------------------------------------------
  168 
  169 # This macro implement the rules to compile and link an Bqm DPlugin with extra arguments.
  170 #
  171 # Usage: DIGIKAM_ADD_BQM_PLUGIN(NAME    _plugin_name_
  172 #                               SOURCE  _plugin_sources_
  173 #                               DEPENDS _plugin_dependencies_)
  174 #
  175 # With: _plugin_name_ the literal name of the plugin (mandatory).
  176 #       _plugin_sources_ the list of source codes to compile (mandatory).
  177 #       _plugin_dependencies_ the list of dependencies to link (optional).
  178 #
  179 # Note: by default a Bqm plugin is linked with digikamcore shared library.
  180 #
  181 # This macro will generate a plugin library with this pattern as file name:
  182 # Bqm_${_pluginname_}_Plugin
  183 #
  184 macro(DIGIKAM_ADD_BQM_PLUGIN)
  185 
  186     set(_OPTIONS_ARGS)
  187     set(_ONE_VALUE_ARGS)
  188     set(_MULTI_VALUE_ARGS NAME SOURCES DEPENDS)
  189 
  190     cmake_parse_arguments(_parse_results "${_OPTIONS_ARGS}"
  191                                          "${_ONE_VALUE_ARGS}"
  192                                          "${_MULTI_VALUE_ARGS}"
  193                                          ${ARGN}
  194     )
  195 
  196     # Mandatory
  197     if(_parse_results_NAME)
  198 #        message(STATUS "Bqm plugin name=${_parse_results_NAME}")
  199     else()
  200         message(FATAL_ERROR "Bqm plugin name is required.")
  201     endif()
  202 
  203     if(_parse_results_SOURCES )
  204 #        message(STATUS "Bqm plugin sources=${_parse_results_SOURCES}")
  205     else()
  206         message(FATAL_ERROR "Bqm plugin sources is required.")
  207     endif()
  208 
  209     # Optional
  210     if(_parse_results_DEPENDS)
  211 #        message(STATUS "Bqm plugin dependencies=${_parse_results_DEPENDS}")
  212     endif()
  213 
  214     if(APPLE)
  215         set(_extra_deps /System/Library/Frameworks/AppKit.framework)
  216     endif()
  217 
  218     add_library(Bqm_${_parse_results_NAME}_Plugin
  219                 MODULE ${_parse_results_SOURCES})
  220 
  221     target_link_libraries(Bqm_${_parse_results_NAME}_Plugin
  222                           digikamcore
  223                           digikamdatabase
  224                           digikamgui
  225 
  226                           Qt5::Core
  227                           Qt5::Gui
  228                           Qt5::Xml
  229                           Qt5::XmlPatterns
  230                           Qt5::Widgets
  231                           Qt5::Sql
  232 
  233                           KF5::XmlGui
  234                           KF5::I18n
  235                           KF5::ConfigCore
  236                           KF5::Service
  237 
  238                           ${_parse_results_DEPENDS}
  239                           ${_extra_deps}
  240     )
  241 
  242     install(TARGETS Bqm_${_parse_results_NAME}_Plugin
  243             DESTINATION ${PLUGIN_INSTALL_DIR}/digikam/bqm
  244     )
  245 
  246 endmacro()