diff --git a/cmake/modules/FindQHelpGenerator.cmake b/cmake/modules/FindQHelpGenerator.cmake new file mode 100644 index 00000000..fcd3f270 --- /dev/null +++ b/cmake/modules/FindQHelpGenerator.cmake @@ -0,0 +1,45 @@ +# Finds the Qt5 QHelpGenerator +# +# QHelpGenerator_FOUND - True if QHelpGenerator found. +# QHelpGenerator_EXECUTABLE - Path to executable + +find_package(Qt5Core QUIET) +if (TARGET Qt5::qhelpgenerator) + get_target_property(QHelpGenerator_EXECUTABLE Qt5::qhelpgenerator LOCATION) +else() + # assume same folder as qmake executable + if (TARGET Qt5::qmake) + get_target_property(_qmake_EXECUTABLE Qt5::qmake LOCATION) + get_filename_component(_path ${_qmake_EXECUTABLE} DIRECTORY) + else() + set(_path) + endif() + # TODO: prevent that the Qt4 version is picked up + find_program(QHelpGenerator_EXECUTABLE + NAMES + qhelpgenerator-qt5 + qhelpgenerator + PATH + ${_path} + ) +endif() +mark_as_advanced(QHelpGenerator_EXECUTABLE) + +if(QHelpGenerator_EXECUTABLE) + set(QHelpGenerator_FOUND TRUE) +else() + set(QHelpGenerator_FOUND FALSE) +endif() + +if(QHelpGenerator_FOUND) + if(NOT QHelpGenerator_FIND_QUIETLY ) + message( STATUS "Found QHelpGenerator executable: ${QHelpGenerator_EXECUTABLE}") + endif() +else() + if(QHelpGenerator_FIND_REQUIRED) + message( FATAL_ERROR "Could not find QHelpGenerator executable" ) + else() + message( STATUS "Optional QHelpGenerator executable was not found" ) + endif() +endif() + diff --git a/cmake/modules/KReportAddQCH.cmake b/cmake/modules/KReportAddQCH.cmake index bf33ee96..67e8eb34 100644 --- a/cmake/modules/KReportAddQCH.cmake +++ b/cmake/modules/KReportAddQCH.cmake @@ -1,636 +1,656 @@ #.rst: # KReportAddQCH # ------------------ # # This module provides the ``kreport_add_qch`` function for generating API # documentation files in the QCH format, and the ``kreport_install_qch_export`` # function for generating and installing exported CMake targets for such # generated QCH files to enable builds of other software with generation of # QCH files to create links into the given QCH files. # # :: # -# kreport_add_qch( -# OUTPUT_BASENAME +# kreport_add_qch( +# NAME # VERSION # QCH_INSTALL_DESTINATION # TAGFILE_INSTALL_DESTINATION +# [BASE_NAME ] # [SOURCE_DIRS [ [...]]] # [SOURCES [ [...]]] # |MD_MAINPAGE ] # [IMAGE_DIRS [ [...]]] # [EXAMPLE_DIRS [ [...]]] # [ORG_DOMAIN ] # [NAMESPACE ] # [LINK_QCHS [ [...]]] # [LINK_QCHS_VERSIONED [ [...]]] # [BLANK_MACROS [ [...]]] # [CONFIG_TEMPLATE ] # [VERBOSE] # ) # -# This macro adds a target called for the creation of an API -# documentation manual named ``.qch``in the QCH format from the -# given sources. +# This macro adds a target called for the creation of an API +# documentation manual in the QCH format from the given sources. # It currently uses doxygen, future versions might optionally also allow other # tools. # Next to the QCH file the target will generate a corresponding doxygen tag -# file name ``.tags``, which enables creating links from other -# documentation into the generated QCH file. +# file, which enables creating links from other documentation into the +# generated QCH file. # # If the required tools are not found, the macro will skip creation of the # target and only emit a warning, so the use of the macro can be introduced # without requiring anyone to also have the needed tools present at that time. # This behaviour might change in future versions to result in a fail instead. # It is recommended to make the use of this macro optional, by depending # the call to ``kreport_add_qch()`` on a CMake option being set, with a name like # ``BUILD_QCH`` and being TRUE by default. This will allow the developers to # saves resources on normal source development build cycles by setting this # option to FALSE. # # The macro will set the target properties DOXYGEN_TAGFILE, QHP_NAMESPACE, # QHP_NAMESPACE_VERSIONED and QHP_VIRTUALFOLDER to the respective values, to # allow other code access to them, e.g. the macro kreport_install_qch_export(). -# To enable the use of the target as item for LINK_QCHS or +# To enable the use of the target as item for LINK_QCHS or # LINK_QCHS_VERSIONED in further ``kreport_add_qch()`` calls in the current build, # additionally a target property DOXYGEN_TAGFILE_BUILD is set, with the path # of the created doxygen tag file in the build dir. # If existing, ``kreport_add_qch()`` will use this property instead of # DOXYGEN_TAGFILE for access to the tags file. # -# OUTPUT_BASENAME specifies the base name for the generated documentation and -# the files. +# NAME specifies the name for the generated documentation. # # VERSION specifies the version of the library for which the documentation is # created. # +# BASE_NAME specifies the base name for the generated files. +# The default basename is ````. +# # SOURCE_DIRS specifies the dirs (incl. subdirs) with the source files for # which the API documentation should be generated. Dirs can be relative to # the current source dir. Dependencies to the files in the dirs are not # tracked currently, other than with the SOURCES argument. So do not use for # sources generated during the build. # Needs to be used when SOURCES or CONFIG_TEMPLATE are not used. # # SOURCES specifies the source files for which the API documentation should be # generated. # Needs to be used when SOURCE_DIRS or CONFIG_TEMPLATE are not used. # # MD_MAINPAGE specifies a file in Markdown format that should be used as main # page. This page will overrule any ``\mainpage`` command in the included # sources. # # IMAGE_DIRS specifies the dirs which contain images that are included in the # documentation. Dirs can be relative to the current source dir. # # EXAMPLE_DIRS specifies the dirs which contain examples that are included in # the documentation. Dirs can be relative to the current source dir. # # QCH_INSTALL_DESTINATION specifies where the generated QCH file will be # installed. # # TAGFILE_INSTALL_DESTINATION specifies where the generated tag file will be # installed. # # NAMESPACE can be used to set a custom namespace of the generated # QCH file. The namepspace is used as the unique id by QHelpEngine (cmp. # http://doc.qt.io/qt-5/qthelpproject.html#namespace). -# The default namespace is ``.``. +# The default namespace is ``.``. # Needs to be used when ORG_DOMAIN is not used. # # ORG_DOMAIN can be used to define the organization domain prefix for the # default namespace of the generated QCH file. # Needs to be used when NAMESPACE is not used. # # LINK_QCHS specifies a list of other QCH targets which should be used for # creating references to API documenation of code in external libraries. # For each target in the list these target properties are expected to be # defined: DOXYGEN_TAGFILE, QHP_NAMESPACE and QHP_VIRTUALFOLDER. # If any of these is not existing, will be ignored. # Use the macro kreport_install_qch_export for exporting a target with these # properties with the CMake config of a library. # Any target can also be one created before in the same buildsystem by # another call of ``kreport_add_qch()``. # # LINK_QCHS_VERSIONED does basically the same as LINK_QCHS, but binds the links # to a certain version. # For each in the list these target properties are expected to be # defined: DOXYGEN_TAGFILE, QHP_NAMESPACE_VERSIONED and QHP_VIRTUALFOLDER. # If any of these is not existing, will be ignored. # Use the macro kreport_install_qch_export for exporting a target with these # properties with the CMake config of a library. # Any can also be one created before in the same buildsystem by another # call of ``kreport_add_qch()``. # # BLANK_MACROS specifies a list of C/C++ macro names which should be ignored by # the API dox generation tool and handled as if they resolve to empty strings. # Examples are export macros only defined in generated files, so whose # definition might be not available to the tool. # # CONFIG_TEMPLATE specifies a custom cmake template file for the config file # that is created to control the execution of the API dox generation tool. # The following CMake variables need to be used: # ECM_DOXYGENQCH_PERL_EXECUTABLE, ECM_DOXYGENQCH_QHELPGENERATOR_EXECUTABLE, # ECM_DOXYGENQCH_FILEPATH, ECM_DOXYGENQCH_TAGFILE. # The following CMake variables can be used: # ECM_DOXYGENQCH_PROJECTNAME, ECM_DOXYGENQCH_PROJECTVERSION, # ECM_DOXYGENQCH_VIRTUALFOLDER, ECM_DOXYGENQCH_FULLNAMESPACE, # ECM_DOXYGENQCH_TAGFILES, # ECM_DOXYGENQCH_WARN_LOGFILE, ECM_DOXYGENQCH_QUIET. # There is no guarantue that the other CMake variables currently used in the # default config file template will also be present with the same semantics # in future versions of this macro. # # VERBOSE tells the API dox generation tool to be more verbose about its # activity. # # Example usage: # # .. code-block:: cmake # # kreport_add_qch( # MyLib_QCH -# OUTPUT_BASENAME MyLib +# NAME MyLib # VERSION "0.42.0" # ORG_DOMAIN org.myorg # SOURCE_DIRS # src # LINK_QCHS # Qt5Core_QCH # Qt5Xml_QCH # Qt5Gui_QCH # Qt5Widgets_QCH # BLANK_MACROS # MyLib_EXPORT # MyLib_DEPRECATED # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # ) # # Example usage (with two QCH files, second linking first): # # .. code-block:: cmake # # kreport_add_qch( # MyLib_QCH -# OUTPUT_BASENAME MyLib +# NAME MyLib # VERSION ${MyLib_VERSION} # ORG_DOMAIN org.myorg # SOURCES ${MyLib_PUBLIC_HEADERS} # MD_MAINPAGE src/mylib/README.md # LINK_QCHS Qt5Core_QCH # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # ) # kreport_add_qch( # MyOtherLib_QCH -# OUTPUT_BASENAME MyOtherLib +# NAME MyOtherLib # VERSION ${MyOtherLib_VERSION} # ORG_DOMAIN org.myorg # SOURCES ${MyOtherLib_PUBLIC_HEADERS} # MD_MAINPAGE src/myotherlib/README.md # LINK_QCHS Qt5Core_QCH MyLib_QCH # TAGFILE_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/tags # QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/share/docs/qch # ) # # :: # # kreport_install_qch_export( # TARGETS [ [ [...]]] # FILE # DESTINATION # [COMPONENT }] # ) # # This macro creates and installs a CMake file which exports the given # QCH targets etc., so they can be picked up by CMake-based builds of # other software that also generate QCH files (using ``kreport_add_qch()``) and # which should include links to the QCH files created by the given targets. # The installed CMake file is expected to be included by the CMake # config file created for the software the related QCH files are documenting. # # TARGETS specifies the QCH targets which should be exported. If a target does # not exist or does not have all needed properties, a warning will be # generated and the target skipped. # This behaviour might change in future versions to result in a fail instead. # # FILE specifies the name of the created CMake file, typically with a .cmake # extension. # # DESTINATION specifies the directory on disk to which the file will be # installed. It usually is the same as the one where the CMake config files # for this software are installed. # # COMPONENT specifies the the installation component name with which the # install rule is associated. # # Example usage: # # .. code-block:: cmake # # kreport_install_qch_export( # TARGETS MyLib_QCH # FILE MyLibQCHTargets.cmake # DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/MyLib" # COMPONENT Devel # ) -# -# Since 5.29.0. #============================================================================= # Copyright 2016 Friedrich W. H. Kossebau # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # needed to find helper files get_filename_component(_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) # Estimate KREPORT_QTQCH_FULL_INSTALL_DIR include(KDEInstallDirs) # for KDE_INSTALL_USE_QT_SYS_PATHS & KDE_INSTALL_FULL_DATAROOTDIR include("${_module_dir}/KReportQueryQmake.cmake") if(KDE_INSTALL_USE_QT_SYS_PATHS) query_qmake(qt_docs_dir QT_INSTALL_DOCS) set(KREPORT_QTQCH_FULL_INSTALL_DIR "${qt_docs_dir}") else() - set(KREPORT_QTQCH_FULL_INSTALL_DIR "${KDE_INSTALL_FULL_DATAROOTDIR}/doc") + set(KREPORT_QTQCH_FULL_INSTALL_DIR "${KDE_INSTALL_FULL_DATAROOTDIR}/doc/qch") endif() include(CMakeParseArguments) function(kreport_add_qch target_name) # Parse arguments set(options VERBOSE) - set(oneValueArgs OUTPUT_BASENAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION VERSION NAMESPACE MD_MAINPAGE ORG_DOMAIN CONFIG_TEMPLATE) + set(oneValueArgs NAME BASE_NAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION VERSION NAMESPACE MD_MAINPAGE ORG_DOMAIN CONFIG_TEMPLATE) set(multiValueArgs SOURCE_DIRS SOURCES IMAGE_DIRS EXAMPLE_DIRS BLANK_MACROS LINK_QCHS LINK_QCHS_VERSIONED) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # check required args - foreach(_arg_name OUTPUT_BASENAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION VERSION) + foreach(_arg_name NAME QCH_INSTALL_DESTINATION TAGFILE_INSTALL_DESTINATION VERSION) if(NOT DEFINED ARGS_${_arg_name}) message(FATAL_ERROR "${_arg_name} needs to be defined when calling kreport_add_qch") endif() endforeach() if(NOT DEFINED ARGS_SOURCE_DIRS AND NOT DEFINED ARGS_SOURCES AND NOT DEFINED ARGS_CONFIG_TEMPLATE) message(FATAL_ERROR "SOURCE_DIRS or SOURCES needs to be defined when calling kreport_add_qch") endif() if(DEFINED ARGS_SOURCE_DIRS AND DEFINED ARGS_SOURCES) message(FATAL_ERROR "Either SOURCE_DIRS or SOURCES, not both, needs to be defined when calling kreport_add_qch") endif() if(NOT DEFINED ARGS_ORG_DOMAIN AND NOT DEFINED ARGS_NAMESPACE) message(FATAL_ERROR "ORG_DOMAIN or NAMESPACE needs to be defined when calling kreport_add_qch") endif() - # create QCH targets for Qt - # Ideally one day Qt CMake Config files provide these - if(NOT TARGET Qt5Core_QCH) - # get Qt version, if any - find_package(Qt5Core CONFIG QUIET) - # lookup tag files - query_qmake(qt_docs_dir QT_INSTALL_DOCS) - find_path(_qtcoreTagsPath qtcore/qtcore.tags - PATHS - ${qt_docs_dir} - ) - - if(Qt5Core_FOUND AND _qtcoreTagsPath) - string(REPLACE "." "" _version ${Qt5Core_VERSION}) - # TODO: properly find each tag file - # TODO: complete list of Qt modules - foreach(_module - Bluetooth Concurrent Core DBus Gui Location Multimedia MultimediaWidgets - Network Positioning PrintSupport Qml Quick Sensors SerialPort Sql Svg - WebEngine WebView Widgets Xml XmlPatterns - ) - string(TOLOWER ${_module} _lowermodule) - - add_custom_target(Qt5${_module}_QCH) - set_target_properties(Qt5${_module}_QCH PROPERTIES - DOXYGEN_TAGFILE "${_qtcoreTagsPath}/qt${_lowermodule}/qt${_lowermodule}.tags" - QHP_NAMESPACE "org.qt-project.qt${_lowermodule}" - QHP_NAMESPACE_VERSIONED "org.qt-project.qt${_lowermodule}.${_version}" - QHP_VIRTUALFOLDER "qt${_lowermodule}" - IMPORTED TRUE - ) - endforeach() - endif() - endif() - # find required tools + # TODO: check with doxygen author if perl is really still required, PERL_PATH seems unused in doxygen find_package(Perl) set_package_properties(Perl PROPERTIES + PURPOSE "Needed for API dox QCH file generation" TYPE OPTIONAL ) - find_package(Doxygen) + if (NOT DOXYGEN_PATCHED_JSFILESADDED) + set(REQUIRED_DOXYGEN_VERSION 1.8.13) + endif() + find_package(Doxygen ${REQUIRED_DOXYGEN_VERSION}) + if (NOT DOXYGEN_FOUND AND NOT DOXYGEN_PATCHED_JSFILESADDED) + set(doxygen_description_addition " (Or older version patched with https://github.com/doxygen/doxygen/commit/bf9415698e53d79b, pass -DDOXYGEN_PATCHED_JSFILESADDED=ON to cmake if patched)") + endif() set_package_properties(Doxygen PROPERTIES TYPE OPTIONAL - DESCRIPTION "Tool for API Documentation generation" - URL "http://www.doxygen.org/" + PURPOSE "Needed for API dox QCH file generation${doxygen_description_addition}" + ) + find_package(QHelpGenerator) + set_package_properties(QHelpGenerator PROPERTIES + TYPE OPTIONAL + PURPOSE "Needed for API dox QCH file generation" + DESCRIPTION "Part of Qt5 tools" ) - if (DOXYGEN_FOUND AND DOXYGEN_VERSION VERSION_LESS 1.8.13 AND NOT DOXYGEN_PATCHED_JSFILESADDED) - message(WARNING "Make sure Doxygen is patched with https://github.com/doxygen/doxygen/commit/bf9415698e53d79b, then pass -DDOXYGEN_PATCHED_JSFILESADDED=ON to cmake") - set(DOXYGEN_FOUND FALSE) + set(_missing_tools) + if (NOT PERL_FOUND) + list(APPEND _missing_tools "Perl") endif() - # TODO: use Qt5::qhelpgenerator for Qt >= 5.7.1 - find_program(ECM_DOXYGENQCH_QHELPGENERATOR_EXECUTABLE NAMES qhelpgenerator-qt5 qhelpgenerator) - - # prepare base dirs, working file names and other vars - set(_qch_file_basename "${ARGS_OUTPUT_BASENAME}.qch") - set(_tags_file_basename "${ARGS_OUTPUT_BASENAME}.tags") - set(_qch_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_qch_file_basename}") - set(_tags_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_tags_file_basename}") - set(_apidox_builddir "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_OUTPUT_BASENAME}_ECMDoxygenQCH") - if (DEFINED ARGS_NAMESPACE) - set(_namespace "${ARGS_NAMESPACE}") - else() - set(_namespace "${ARGS_ORG_DOMAIN}.${ARGS_OUTPUT_BASENAME}") + if (NOT DOXYGEN_FOUND) + list(APPEND _missing_tools "Doxygen") endif() - string(REPLACE "." "_" _dotLessVersion ${ARGS_VERSION}) - set(_versioned_namespace "${_namespace}.${_dotLessVersion}") - set(_sources) - set(_dep_tagfiles) - set(_dep_qch_targets) - - ### Create doxygen config file - set(_doxygenconfig_file "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_OUTPUT_BASENAME}_ECMDoxygenQCH.config") - if (DEFINED ARGS_CONFIG_TEMPLATE) - set(_doxygenconfig_template_file "${ARGS_CONFIG_TEMPLATE}") - else() - set(_doxygenconfig_template_file "${_module_dir}/KReportDoxygenQCH.config.in") + if (NOT QHelpGenerator_FOUND) + list(APPEND _missing_tools "qhelpgenerator") endif() - # Setup variables used in config file template, ECM_DOXYGENQCH_* - set(ECM_DOXYGENQCH_OUTPUTDIR "\"${_apidox_builddir}\"") - set(ECM_DOXYGENQCH_TAGFILE "\"${_tags_buildpath}\"") - set(ECM_DOXYGENQCH_LAYOUTFILE "\"${_module_dir}/KReportDoxygenQCHLayout.xml\"") - set(ECM_DOXYGENQCH_IMAGEDIRS) - foreach(_image_DIR IN LISTS ARGS_IMAGE_DIRS) - if (NOT IS_ABSOLUTE ${_image_DIR}) - set(_image_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_image_DIR}") + + if (_missing_tools) + message(WARNING "API dox QCH file will not be generated, tools missing: ${_missing_tools}!") + else() + set(ECM_DOXYGENQCH_QHELPGENERATOR_EXECUTABLE ${QHelpGenerator_EXECUTABLE}) + # create QCH targets for Qt + # Ideally one day Qt CMake Config files provide these + if(NOT TARGET Qt5Core_QCH) + # get Qt version, if any + find_package(Qt5Core CONFIG QUIET) + # lookup tag files + query_qmake(qt_docs_dir QT_INSTALL_DOCS) + find_path(_qtcoreTagsPath qtcore/qtcore.tags + PATHS + ${qt_docs_dir} + ) + + if(Qt5Core_FOUND AND _qtcoreTagsPath) + string(REPLACE "." "" _version ${Qt5Core_VERSION}) + # TODO: properly find each tag file + # TODO: complete list of Qt modules + foreach(_module + Bluetooth Concurrent Core DBus Gui Location Multimedia MultimediaWidgets + Network Positioning PrintSupport Qml Quick Sensors SerialPort Sql Svg + WebEngine WebView Widgets Xml XmlPatterns + ) + string(TOLOWER ${_module} _lowermodule) + + add_custom_target(Qt5${_module}_QCH) + set_target_properties(Qt5${_module}_QCH PROPERTIES + DOXYGEN_TAGFILE "${_qtcoreTagsPath}/qt${_lowermodule}/qt${_lowermodule}.tags" + QHP_NAMESPACE "org.qt-project.qt${_lowermodule}" + QHP_NAMESPACE_VERSIONED "org.qt-project.qt${_lowermodule}.${_version}" + QHP_VIRTUALFOLDER "qt${_lowermodule}" + IMPORTED TRUE + ) + endforeach() + endif() endif() - # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_IMAGEDIRS "${ECM_DOXYGENQCH_IMAGEDIRS} \\\n\"${_image_DIR}\"") - endforeach() - set(ECM_DOXYGENQCH_EXAMPLEDIRS) - foreach(_example_DIR IN LISTS ARGS_EXAMPLE_DIRS) - if (NOT IS_ABSOLUTE ${_example_DIR}) - set(_example_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_example_DIR}") + + # prepare base dirs, working file names and other vars + if (DEFINED ARGS_BASE_NAME) + set(_basename ${ARGS_BASE_NAME}) + else() + set(_basename ${ARGS_NAME}) endif() - # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_EXAMPLEDIRS "${ECM_DOXYGENQCH_EXAMPLEDIRS} \\\n\"${_example_DIR}\"") - endforeach() - if (ARGS_MD_MAINPAGE) - if (NOT IS_ABSOLUTE ${ARGS_MD_MAINPAGE}) - set(ARGS_MD_MAINPAGE "${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_MD_MAINPAGE}") + set(_qch_file_basename "${_basename}.qch") + set(_tags_file_basename "${_basename}.tags") + set(_qch_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_qch_file_basename}") + set(_tags_buildpath "${CMAKE_CURRENT_BINARY_DIR}/${_tags_file_basename}") + set(_apidox_builddir "${CMAKE_CURRENT_BINARY_DIR}/${_basename}_ECMDoxygenQCH") + if (DEFINED ARGS_NAMESPACE) + set(_namespace "${ARGS_NAMESPACE}") + else() + set(_namespace "${ARGS_ORG_DOMAIN}.${ARGS_NAME}") endif() - set(ECM_DOXYGENQCH_MAINPAGE_MDFILE "\"${ARGS_MD_MAINPAGE}\"") - else() - set(ECM_DOXYGENQCH_MAINPAGE_MDFILE) - endif() - set(ECM_DOXYGENQCH_INPUT) - if (ARGS_SOURCE_DIRS) - foreach(_source_DIR IN LISTS ARGS_SOURCE_DIRS) - if (NOT IS_ABSOLUTE ${_source_DIR}) - set(_source_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_source_DIR}") + string(REPLACE "." "_" _dotLessVersion ${ARGS_VERSION}) + set(_versioned_namespace "${_namespace}.${_dotLessVersion}") + set(_sources) + set(_dep_tagfiles) + set(_dep_qch_targets) + + ### Create doxygen config file + set(_doxygenconfig_file "${CMAKE_CURRENT_BINARY_DIR}/${_basename}_ECMDoxygenQCH.config") + if (DEFINED ARGS_CONFIG_TEMPLATE) + set(_doxygenconfig_template_file "${ARGS_CONFIG_TEMPLATE}") + else() + set(_doxygenconfig_template_file "${_module_dir}/KReportDoxygenQCH.config.in") + endif() + # Setup variables used in config file template, ECM_DOXYGENQCH_* + set(ECM_DOXYGENQCH_OUTPUTDIR "\"${_apidox_builddir}\"") + set(ECM_DOXYGENQCH_TAGFILE "\"${_tags_buildpath}\"") + set(ECM_DOXYGENQCH_LAYOUTFILE "\"${_module_dir}/KReportDoxygenQCHLayout.xml\"") + set(ECM_DOXYGENQCH_IMAGEDIRS) + foreach(_image_DIR IN LISTS ARGS_IMAGE_DIRS) + if (NOT IS_ABSOLUTE ${_image_DIR}) + set(_image_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_image_DIR}") endif() # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${_source_DIR}\"") + set(ECM_DOXYGENQCH_IMAGEDIRS "${ECM_DOXYGENQCH_IMAGEDIRS} \\\n\"${_image_DIR}\"") endforeach() - if (ARGS_MD_MAINPAGE) - set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${ARGS_MD_MAINPAGE}\"") - endif() - set(ECM_DOXYGENQCH_FILE_PATTERNS "*.h *.cpp *.hpp *.hh *.cc *.h++ *.c++ *.hxx *.cxx *.dox *.md") - else() - foreach(_source IN LISTS ARGS_SOURCES) - if (NOT IS_ABSOLUTE ${_source}) - set(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_source}") + set(ECM_DOXYGENQCH_EXAMPLEDIRS) + foreach(_example_DIR IN LISTS ARGS_EXAMPLE_DIRS) + if (NOT IS_ABSOLUTE ${_example_DIR}) + set(_example_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_example_DIR}") endif() - list(APPEND _sources "${_source}") + # concat dirs separated by a break, it is no issue that first has also a leading break + set(ECM_DOXYGENQCH_EXAMPLEDIRS "${ECM_DOXYGENQCH_EXAMPLEDIRS} \\\n\"${_example_DIR}\"") endforeach() if (ARGS_MD_MAINPAGE) - list(FIND _sources ${ARGS_MD_MAINPAGE} _mainpage_index) - if (_mainpage_index STREQUAL -1) - list(APPEND _sources "${ARGS_MD_MAINPAGE}") + if (NOT IS_ABSOLUTE ${ARGS_MD_MAINPAGE}) + set(ARGS_MD_MAINPAGE "${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_MD_MAINPAGE}") endif() + set(ECM_DOXYGENQCH_MAINPAGE_MDFILE "\"${ARGS_MD_MAINPAGE}\"") + else() + set(ECM_DOXYGENQCH_MAINPAGE_MDFILE) endif() - foreach(_source IN LISTS _sources) - # concat sources separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${_source}\"") - endforeach() - set(ECM_DOXYGENQCH_FILE_PATTERNS "") - endif() - - set(ECM_DOXYGENQCH_PROJECTNAME ${ARGS_OUTPUT_BASENAME}) - file(RELATIVE_PATH _builddirrelative_filepath "${_apidox_builddir}/html" ${_qch_buildpath}) - set(ECM_DOXYGENQCH_FILEPATH "\"${_builddirrelative_filepath}\"") - set(ECM_DOXYGENQCH_PROJECTVERSION ${ARGS_VERSION}) - set(ECM_DOXYGENQCH_VIRTUALFOLDER "${ARGS_OUTPUT_BASENAME}") - set(ECM_DOXYGENQCH_FULLNAMESPACE ${_versioned_namespace}) - set(ECM_DOXYGENQCH_BLANK_MACROS) - foreach(_macro IN LISTS ARGS_BLANK_MACROS) - # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_BLANK_MACROS "${ECM_DOXYGENQCH_BLANK_MACROS} \\\n${_macro}=\"\"") - endforeach() - set(ECM_DOXYGENQCH_TAGFILES) - foreach(_versioned_postfix "" "_VERSIONED") - foreach(_link_qch IN LISTS ARGS_LINK_QCHS${_versioned_postfix}) - set(_target_usable TRUE) - if (NOT TARGET ${_link_qch}) - message(STATUS "No such target ${_link_qch} defined when calling kreport_add_qch().") - set(_target_usable FALSE) - elseif() - foreach(_propertyname - DOXYGEN_TAGFILE - QHP_NAMESPACE${_versioned_postfix} - QHP_VIRTUALFOLDER - ) - if(NOT "${_property}") - message(STATUS "No property ${_propertyname} set on ${_link_qch} when calling kreport_add_qch().") - set(_target_usable FALSE) - endif() - endforeach() - endif() - if(_target_usable) - list(APPEND _dep_qch_targets ${_link_qch}) - get_target_property(_link_qch_tagfile ${_link_qch} DOXYGEN_TAGFILE) - get_target_property(_link_qch_tagfile_build ${_link_qch} DOXYGEN_TAGFILE_BUILD) - get_target_property(_link_qch_namespace ${_link_qch} QHP_NAMESPACE${_versioned_postfix}) - get_target_property(_link_qch_virtualfolder ${_link_qch} QHP_VIRTUALFOLDER) - # if same build, then prefer build version over any installed one - if (${_link_qch_tagfile_build}) - set(_link_qch_tagfile ${_link_qch_tagfile_build}) - list(APPEND _dep_tagfiles "${_link_qch_tagfile}") + set(ECM_DOXYGENQCH_INPUT) + if (ARGS_SOURCE_DIRS) + foreach(_source_DIR IN LISTS ARGS_SOURCE_DIRS) + if (NOT IS_ABSOLUTE ${_source_DIR}) + set(_source_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${_source_DIR}") endif() - set(_tagfile_entry "\"${_link_qch_tagfile}=qthelp://${_link_qch_namespace}/${_link_qch_virtualfolder}/\"") # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_DOXYGENQCH_TAGFILES "${ECM_DOXYGENQCH_TAGFILES} \\\n${_tagfile_entry}") - else() - message(WARNING "No linking to API dox of ${_link_qch}.") + set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${_source_DIR}\"") + endforeach() + if (ARGS_MD_MAINPAGE) + set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${ARGS_MD_MAINPAGE}\"") + endif() + set(ECM_DOXYGENQCH_FILE_PATTERNS "*.h *.cpp *.hpp *.hh *.cc *.h++ *.c++ *.hxx *.cxx *.dox *.md") + else() + foreach(_source IN LISTS ARGS_SOURCES) + if (NOT IS_ABSOLUTE ${_source}) + set(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_source}") + endif() + list(APPEND _sources "${_source}") + endforeach() + if (ARGS_MD_MAINPAGE) + list(FIND _sources ${ARGS_MD_MAINPAGE} _mainpage_index) + if (_mainpage_index STREQUAL -1) + list(APPEND _sources "${ARGS_MD_MAINPAGE}") + endif() endif() + foreach(_source IN LISTS _sources) + # concat sources separated by a break, it is no issue that first has also a leading break + set(ECM_DOXYGENQCH_INPUT "${ECM_DOXYGENQCH_INPUT} \\\n\"${_source}\"") + endforeach() + set(ECM_DOXYGENQCH_FILE_PATTERNS "") + endif() + + set(ECM_DOXYGENQCH_PROJECTNAME ${ARGS_NAME}) + file(RELATIVE_PATH _builddirrelative_filepath "${_apidox_builddir}/html" ${_qch_buildpath}) + set(ECM_DOXYGENQCH_FILEPATH "\"${_builddirrelative_filepath}\"") + set(ECM_DOXYGENQCH_PROJECTVERSION ${ARGS_VERSION}) + set(ECM_DOXYGENQCH_VIRTUALFOLDER "${ARGS_NAME}") + set(ECM_DOXYGENQCH_FULLNAMESPACE ${_versioned_namespace}) + set(ECM_DOXYGENQCH_BLANK_MACROS) + foreach(_macro IN LISTS ARGS_BLANK_MACROS) + # concat dirs separated by a break, it is no issue that first has also a leading break + set(ECM_DOXYGENQCH_BLANK_MACROS "${ECM_DOXYGENQCH_BLANK_MACROS} \\\n${_macro}=\"\"") + endforeach() + set(ECM_DOXYGENQCH_TAGFILES) + foreach(_versioned_postfix "" "_VERSIONED") + foreach(_link_qch IN LISTS ARGS_LINK_QCHS${_versioned_postfix}) + set(_target_usable TRUE) + if (NOT TARGET ${_link_qch}) + message(STATUS "No such target ${_link_qch} defined when calling kreport_add_qch().") + set(_target_usable FALSE) + elseif() + foreach(_propertyname + DOXYGEN_TAGFILE + QHP_NAMESPACE${_versioned_postfix} + QHP_VIRTUALFOLDER + ) + get_target_property(_property ${_target} ${_propertyname}) + if(NOT "${_property}") + message(STATUS "No property ${_propertyname} set on ${_link_qch} when calling kreport_add_qch().") + set(_target_usable FALSE) + endif() + endforeach() + endif() + if(_target_usable) + list(APPEND _dep_qch_targets ${_link_qch}) + get_target_property(_link_qch_tagfile ${_link_qch} DOXYGEN_TAGFILE) + get_target_property(_link_qch_tagfile_build ${_link_qch} DOXYGEN_TAGFILE_BUILD) + get_target_property(_link_qch_namespace ${_link_qch} QHP_NAMESPACE${_versioned_postfix}) + get_target_property(_link_qch_virtualfolder ${_link_qch} QHP_VIRTUALFOLDER) + # if same build, then prefer build version over any installed one + if (_link_qch_tagfile_build) + set(_link_qch_tagfile ${_link_qch_tagfile_build}) + list(APPEND _dep_tagfiles "${_link_qch_tagfile}") + endif() + set(_tagfile_entry "\"${_link_qch_tagfile}=qthelp://${_link_qch_namespace}/${_link_qch_virtualfolder}/\"") + # concat dirs separated by a break, it is no issue that first has also a leading break + set(ECM_DOXYGENQCH_TAGFILES "${ECM_DOXYGENQCH_TAGFILES} \\\n${_tagfile_entry}") + else() + message(WARNING "No linking to API dox of ${_link_qch}.") + endif() + endforeach() endforeach() - endforeach() - set(ECM_DOXYGENQCH_WARN_LOGFILE "\"${_doxygenconfig_file}.log\"") - if(ARGS_VERBOSE) - set(ECM_DOXYGENQCH_QUIET "NO") - else() - set(ECM_DOXYGENQCH_QUIET "YES") - endif() - set(ECM_DOXYGENQCH_PERL_EXECUTABLE "${PERL_EXECUTABLE}") + set(ECM_DOXYGENQCH_WARN_LOGFILE "\"${_doxygenconfig_file}.log\"") + if(ARGS_VERBOSE) + set(ECM_DOXYGENQCH_QUIET "NO") + else() + set(ECM_DOXYGENQCH_QUIET "YES") + endif() + set(ECM_DOXYGENQCH_PERL_EXECUTABLE "${PERL_EXECUTABLE}") - if (NOT DOXYGEN_FOUND) - message(WARNING "Unable to find the doxygen utility - API dox QCH file will not be generated!") - elseif(NOT ECM_DOXYGENQCH_QHELPGENERATOR_EXECUTABLE) - message(WARNING "Unable to find the qhelpgenerator utility - API dox QCH file will not be generated!") - elseif(NOT PERL_FOUND) - message(WARNING "Unable to find the perl utility - API dox QCH file will not be generated!") - else() configure_file( "${_doxygenconfig_template_file}" "${_doxygenconfig_file}" @ONLY ) set(_qch_INSTALLPATH ${ARGS_QCH_INSTALL_DESTINATION}) set(_tags_INSTALLPATH ${ARGS_TAGFILE_INSTALL_DESTINATION}) file(RELATIVE_PATH _relative_qch_file ${CMAKE_BINARY_DIR} ${_qch_buildpath}) file(RELATIVE_PATH _relative_tags_file ${CMAKE_BINARY_DIR} ${_tags_buildpath}) add_custom_command( OUTPUT ${_qch_buildpath} ${_tags_buildpath} COMMENT "Generating ${_relative_qch_file}, ${_relative_tags_file}" COMMAND cmake -E remove_directory "${ECM_DOXYGENQCH_OUTPUTDIR}" COMMAND cmake -E make_directory "${ECM_DOXYGENQCH_OUTPUTDIR}" COMMAND ${DOXYGEN_EXECUTABLE} "${_doxygenconfig_file}" DEPENDS ${_doxygenconfig_file} ${_sources} ${_dep_tagfiles} ${_dep_qch_targets} ) add_custom_target(${target_name} ALL DEPENDS ${_qch_buildpath} ${_tags_buildpath}) set_target_properties(${target_name} PROPERTIES DOXYGEN_TAGFILE "${_qch_INSTALLPATH}/${_tags_file_basename}" DOXYGEN_TAGFILE_BUILD "${_tags_buildpath}" QHP_NAMESPACE "${_namespace}" QHP_NAMESPACE_VERSIONED "${_versioned_namespace}" QHP_VIRTUALFOLDER "${ECM_DOXYGENQCH_VIRTUALFOLDER}" ) install(FILES ${_qch_buildpath} DESTINATION ${_qch_INSTALLPATH} COMPONENT Devel ) install(FILES ${_tags_buildpath} DESTINATION ${_tags_INSTALLPATH} COMPONENT Devel ) endif() endfunction() function(kreport_install_qch_export) set(options ) set(oneValueArgs FILE DESTINATION COMPONENT) set(multiValueArgs TARGETS) cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT DEFINED ARGS_FILE) message(FATAL_ERROR "FILE needs to be defined when calling kreport_install_qch_export().") endif() if(NOT DEFINED ARGS_DESTINATION) message(FATAL_ERROR "DESTINATION needs to be defined when calling kreport_install_qch_export().") endif() # TARGETS may be empty (and ARGS_TARGETS will not be defined then by cmake_parse_arguments) set(_content "# Generated by kreport_install_qch_export() # Any changes to this file will be overwritten by the next CMake run. " ) foreach(_target IN LISTS ARGS_TARGETS) set(_target_usable TRUE) if (NOT TARGET ${_target}) message(STATUS "No such target ${_target} when calling kreport_install_qch_export().") set(_target_usable FALSE) else() foreach(_propertyname DOXYGEN_TAGFILE QHP_NAMESPACE QHP_NAMESPACE_VERSIONED QHP_VIRTUALFOLDER ) get_target_property(_property ${_target} ${_propertyname}) if(NOT _property) message(STATUS "No property ${_propertyname} set on ${_target} when calling kreport_install_qch_export(). <${_property}>") set(_target_usable FALSE) endif() endforeach() endif() if(_target_usable) get_target_property(_tagfile ${_target} DOXYGEN_TAGFILE) get_target_property(_namespace ${_target} QHP_NAMESPACE) get_target_property(_namespace_versioned ${_target} QHP_NAMESPACE_VERSIONED) get_target_property(_virtualfolder ${_target} QHP_VIRTUALFOLDER) set(_content "${_content} if (NOT TARGET ${_target}) add_custom_target(${_target}) set_target_properties(${_target} PROPERTIES DOXYGEN_TAGFILE \"${_tagfile}\" QHP_NAMESPACE \"${_namespace}\" QHP_NAMESPACE_VERSIONED \"${_namespace_versioned}\" QHP_VIRTUALFOLDER \"${_virtualfolder}\" IMPORTED TRUE ) endif() " ) else() message(STATUS "No target exported for ${_target}.") endif() endforeach() if (NOT IS_ABSOLUTE ${ARGS_FILE}) set(ARGS_FILE "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_FILE}") endif() file(GENERATE OUTPUT "${ARGS_FILE}" CONTENT "${_content}" ) if (DEFINED ARGS_COMPONENT) set(_component COMPONENT ${ARGS_COMPONENT}) endif() install( FILES "${ARGS_FILE}" DESTINATION "${ARGS_DESTINATION}" ${_component} ) endfunction() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8639451d..df6bbba1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,372 +1,373 @@ # Options simple_option(KREPORT_SCRIPTING "Scripting support using JavaScript language" ON) if(KREPORT_SCRIPTING) find_package(Qt5Qml REQUIRED) set(SCRIPTING_LIBS Qt5::Qml) endif() set(kreport_LIB_SRCS common/kreport_debug.cpp common/kreportplugin_debug.cpp common/KReportPosition.cpp common/KReportSize.cpp common/KReportItemBase.cpp common/KReportAsyncItemBase.cpp common/KReportSectionData.cpp common/KReportLabelSizeInfo.cpp common/KReportDocument.cpp common/KReportDetailSectionData.cpp common/KReportPluginInterface.cpp common/KReportItemLine.cpp common/KReportRenderObjects.cpp common/KReportPluginManager.cpp common/KReportJsonTrader_p.cpp common/KReportPluginMetaData.cpp common/KReportData.cpp common/KReportUtils.cpp common/KReportPageSize.cpp common/KReportUnit.cpp common/KReportDesign.cpp common/KReportDesign_p.cpp common/KReportLineStyle.cpp common/KReportElement.cpp ${PROJECT_BINARY_DIR}/src/KReportElement_sdc.cpp common/KReportSection.cpp renderer/KReportPrintRenderer_p.cpp renderer/KReportPreRenderer.cpp renderer/KReportAsyncItemManager_p.cpp renderer/KReportScreenRenderer_p.cpp renderer/KReportHTMLTableRenderer_p.cpp renderer/KReportHTMLCSSRenderer_p.cpp #TODO renderer/KReportKSpreadRenderer.cpp #TODO renderer/KReportODTRenderer.cpp #TODO renderer/KOdtFrameReportRenderer.cpp renderer/KReportRendererBase.cpp renderer/KReportPage.cpp renderer/KReportView.cpp renderer/KReportOneRecordData_p.cpp wrtembed/KReportDetailGroupSectionDialog.cpp wrtembed/KReportDesignerItemBase.cpp wrtembed/KReportDesignerItemRectBase.cpp wrtembed/KReportDesignerItemLine.cpp wrtembed/KReportDesignerSection.cpp wrtembed/KReportDesignerSectionDetailGroup.cpp wrtembed/KReportDesignerSectionDetail.cpp wrtembed/KReportDesignerSectionScene.cpp wrtembed/KReportDesignerSectionView.cpp wrtembed/KReportDesigner.cpp wrtembed/KReportPropertiesButton.cpp wrtembed/KReportSectionEditor.cpp wrtembed/KReportDpi.cpp wrtembed/KReportRuler.cpp wrtembed/KReportZoomHandler.cpp wrtembed/KReportZoomMode.cpp items/label/KReportItemLabel.cpp items/label/KReportDesignerItemLabel.cpp items/label/KReportLabelPlugin.cpp items/label/KReportBoundedTextItem.cpp items/label/KReportLabelElement.cpp items/label/label.json items/check/KReportItemCheck.cpp items/check/KReportDesignerItemCheckBox.cpp items/check/KReportCheckBoxPlugin.cpp items/check/check.json items/field/KReportItemField.cpp items/field/KReportDesignerItemField.cpp items/field/KReportFieldPlugin.cpp items/field/field.json items/image/KReportItemImage.cpp items/image/KReportDesignerItemImage.cpp items/image/KReportImagePlugin.cpp items/image/image.json items/text/KReportItemText.cpp items/text/KReportDesignerItemText.cpp items/text/KReportTextPlugin.cpp items/text/text.json # non-source: Mainpage.dox Messages.sh ) set(kreport_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/common ${CMAKE_CURRENT_SOURCE_DIR}/wrtembed ${CMAKE_CURRENT_SOURCE_DIR}/renderer ) set(kreport_TARGET_INCLUDE_DIRS common renderer wrtembed ) if(KREPORT_SCRIPTING) list(APPEND kreport_LIB_SRCS renderer/scripting/KReportScriptHandler.cpp renderer/scripting/KReportScriptConstants.cpp renderer/scripting/KReportScriptDebug.cpp renderer/scripting/KReportScriptDraw.cpp renderer/scripting/KReportScriptReport.cpp renderer/scripting/KReportScriptSection.cpp renderer/scripting/KReportScriptLine.cpp #renderer/odtframe/KoOdtFrameReportDocument.cpp #renderer/odtframe/KoOdtFrameReportCheckBox.cpp #renderer/odtframe/KoOdtFrameReportImage.cpp #renderer/odtframe/KoOdtFrameReportTextBox.cpp #renderer/odtframe/KoOdtFrameReportLine.cpp #renderer/odtframe/KoOdtFrameReportPicture.cpp #renderer/odtframe/KoOdtFrameReportPrimitive.cpp #renderer/ods/KoSimpleOdsDocument.cpp #renderer/ods/KoSimpleOdsSheet.cpp #renderer/ods/KoSimpleOdsCell.cpp items/label/KReportScriptLabel.cpp items/check/KReportScriptCheck.cpp items/field/KReportScriptField.cpp items/image/KReportScriptImage.cpp items/text/KReportScriptText.cpp ) qt_wrap_cpp(KReport kreport_LIB_SRCS renderer/scripting/KReportGroupTracker.h ) list(APPEND kreport_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/renderer/scripting ) list(APPEND kreport_TARGET_INCLUDE_DIRS renderer/scripting ) endif() qt5_wrap_ui(kreport_LIB_SRCS wrtembed/KReportDetailGroupSectionDialog.ui wrtembed/KReportSectionEditor.ui ) ecm_create_qm_loader(kreport_LIB_SRCS kreport_qt) add_library(KReport SHARED ${kreport_LIB_SRCS}) set_coinstallable_lib_version(KReport) kdb_create_shared_data_classes( kreport_GENERATED_SHARED_DATA_CLASS_HEADERS # output variable with list of headers NO_PREFIX # subdirectory in which the headers should be generated common/KReportLineStyle.shared.h common/KReportElement.shared.h common/KReportSection.shared.h items/label/KReportLabelElement.shared.h ) kdb_remove_extensions( kreport_GENERATED_SHARED_DATA_CLASS_BASENAMES ${kreport_GENERATED_SHARED_DATA_CLASS_HEADERS} ) generate_export_header(KReport) #qt5_use_modules(KReport Widgets Xml PrintSupport) target_include_directories(KReport PUBLIC "$" INTERFACE "$" PRIVATE ${kreport_TARGET_INCLUDE_DIRS} ) target_link_libraries(KReport PUBLIC Qt5::PrintSupport Qt5::Xml KF5::CoreAddons KPropertyWidgets PRIVATE KF5::WidgetsAddons KF5::ConfigGui # KStandardShortcut ${SCRIPTING_LIBS} #KF5::KIOCore #KF5::KIOFileWidgets #KF5::KIOWidgets #KF5::KIONTLM ) ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KREPORT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kreport_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KReportConfigVersion.cmake" ) install(TARGETS KReport EXPORT KReportTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) # Create a Config.cmake and a ConfigVersion.cmake file and install them set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/${KREPORT_BASE_NAME}") # A place for KReport plugins set(KREPORT_PLUGIN_INSTALL_DIR ${PLUGIN_INSTALL_DIR}/kreport${PROJECT_STABLE_VERSION_MAJOR}) ecm_configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KReportConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KReportConfig.cmake" INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KReportConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KReportConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel) install(EXPORT KReportTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KReportTargets.cmake) ecm_generate_pri_file( BASE_NAME ${KREPORT_BASE_NAME} LIB_NAME ${KREPORT_BASE_NAME} DEPS "widgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KREPORT_INCLUDE_INSTALL_DIR} ) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) install(FILES kreport_elementplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE common HEADER_NAMES KReportPageSize KReportData KReportItemBase KReportItemLine KReportPluginMetaData KReportPluginManager KReportPluginInterface KReportUnit KReportUtils KReportDesign KReportSize KReportPosition KReportDocument KReportSectionData KReportRenderObjects KReportAsyncItemBase ) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE renderer HEADER_NAMES KReportPage KReportRendererBase KReportPreRenderer KReportView ) if(KREPORT_SCRIPTING) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE renderer/scripting HEADER_NAMES KReportScriptHandler KReportScriptDraw KReportScriptConstants KReportGroupTracker ) endif() ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE wrtembed HEADER_NAMES KReportZoomMode KReportDesignerSectionDetail KReportDesignerSection KReportDpi KReportZoomHandler KReportDesignerItemBase KReportDesignerSectionDetailGroup KReportDesignerItemRectBase KReportDesigner ) ecm_generate_headers(kreport_FORWARDING_HEADERS_FROM_BUILDDIR REQUIRED_HEADERS kreport_HEADERS_FROM_BUILDDIR ORIGINAL CAMELCASE SOURCE_DIR ${PROJECT_BINARY_DIR}/src HEADER_NAMES ${kreport_GENERATED_SHARED_DATA_CLASS_BASENAMES} ) list(APPEND kreport_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/kreport_version.h) install( FILES ${kreport_HEADERS} ${kreport_HEADERS_FROM_BUILDDIR} ${kreport_FORWARDING_HEADERS} ${kreport_FORWARDING_HEADERS_FROM_BUILDDIR} ${PROJECT_BINARY_DIR}/src/kreport_export.h ${PROJECT_BINARY_DIR}/src/config-kreport.h DESTINATION ${KREPORT_INCLUDE_INSTALL_DIR} COMPONENT Devel ) if(BUILD_QCH) kreport_add_qch( KReport_QCH - OUTPUT_BASENAME ${KREPORT_BASE_NAME} + NAME KReport + BASE_NAME ${KREPORT_BASE_NAME} VERSION ${PROJECT_VERSION} - ORG_DOMAIN org.kde + NAMESPACE org.kde.${KREPORT_BASE_NAME} SOURCES Mainpage.dox ${kreport_HEADERS} ${kreport_HEADERS_FROM_BUILDDIR} LINK_QCHS Qt5Core_QCH Qt5Xml_QCH Qt5Gui_QCH Qt5Widgets_QCH Qt5PrintSupport_QCH KF5CoreAddons_QCH KPropertyCore_QCH KPropertyWidgets_QCH BLANK_MACROS KREPORT_EXPORT KREPORT_DEPRECATED TAGFILE_INSTALL_DESTINATION ${KREPORT_QTQCH_FULL_INSTALL_DIR} QCH_INSTALL_DESTINATION ${KREPORT_QTQCH_FULL_INSTALL_DIR} ) set(kreport_qch_targets KReport_QCH) endif() kreport_install_qch_export( TARGETS ${kreport_qch_targets} FILE KReportQCHTargets.cmake DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) add_subdirectory(plugins) add_subdirectory(pics) enable_testing() configure_file(config-kreport.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kreport.h)