diff --git a/CMakeLists.txt b/CMakeLists.txt index 9627c15f..923f478e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,65 +1,65 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR) find_package(ECM 1.8.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(SetKReportCMakePolicies NO_POLICY_SCOPE) project(KReport VERSION 3.1.90) # Update this include(KReportAddTests) include(KReportAddExamples) kreport_add_tests(OFF) kreport_add_examples(OFF) # CMake include(CMakePackageConfigHelpers) # ECM include(ECMGeneratePriFile) include(ECMPoQmTools) include(ECMSetupVersion) include(ECMInstallIcons) include(ECMOptionalAddSubdirectory) include(KDEInstallDirs) include(KDECMakeSettings NO_POLICY_SCOPE) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) # Own include(KReportAddIconsRccFile) include(KReportAddQCH) include(KReportMacros) simple_option(BUILD_QCH "Build API documentation in QCH format" OFF) # Dependencies set(REQUIRED_QT_VERSION 5.4.0) set(REQUIRED_KF5_VERSION 5.16.0) -set(REQUIRED_KPROPERTY_VERSION 3.0.94) +set(REQUIRED_KPROPERTY_VERSION 3.1.0) # Required components to build this framework # TODO move Widgets/KF5WidgetsAddons-dependent part to a libKReportDesigner find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core Widgets Xml PrintSupport) find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED CoreAddons WidgetsAddons GuiAddons Config) find_package(KPropertyWidgets ${REQUIRED_KPROPERTY_VERSION} COMPONENTS KF) set_package_properties(KPropertyWidgets PROPERTIES TYPE REQUIRED PURPOSE "Required by KReport for handling properties") get_git_revision_and_branch() add_unfinished_features_option() add_pc_file(${PROJECT_NAME}) add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(autotests) #add_subdirectory(tests) endif() if(BUILD_EXAMPLES) add_subdirectory(examples) endif() if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) endif() feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/modules/KReportAddIconsRccFile.cmake b/cmake/modules/KReportAddIconsRccFile.cmake index 36538c3d..c1b72568 100644 --- a/cmake/modules/KReportAddIconsRccFile.cmake +++ b/cmake/modules/KReportAddIconsRccFile.cmake @@ -1,88 +1,88 @@ # Copyright (C) 2016 Jarosław Staniek # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. add_custom_target(update_all_rcc COMMENT "Updating all file lists for rcc icons files" ) # Builds and install an rcc file with icons. # - resource subdirectory in the current build subdir is created # - ${_target}.qrc is created based on icons/${_theme}/files.cmake # - ${_target}.rcc is generated using rcc-qt5 # - if _prefix is not empty, icons are placed in icons/${_prefix}/${_theme} path (useful for plugins) # - dependency for the parent target ${_parent_target} is added # - the .rcc file is installed to ${ICONS_INSTALL_DIR} # - update_${_target} target is added for requesting update of icons/${_theme}/files.cmake # - adds a update_all_rcc target that executes commands for all targets created with kreport_add_icons_rcc_file() macro(kreport_add_icons_rcc_file _target _parent_target _theme _prefix) set(_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/resource) set(_QRC_FILE "${_BASE_DIR}/${_target}.qrc") - set(_RCC_DIR "${CMAKE_BINARY_DIR}/bin/data/icons") + set(_RCC_DIR "${CMAKE_BINARY_DIR}/bin/data/${KREPORT_BASE_NAME_LOWER}/icons") set(_RCC_FILE "${_RCC_DIR}/${_target}.rcc") include(icons/${_theme}/files.cmake) add_custom_target(${_target}_copy_icons COMMAND ${CMAKE_COMMAND} -E remove_directory ${_BASE_DIR} COMMAND ${CMAKE_COMMAND} -E make_directory ${_BASE_DIR} COMMAND ${CMAKE_COMMAND} -E make_directory ${_RCC_DIR} COMMAND ${CMAKE_COMMAND} -E copy_directory icons/${_theme} ${_BASE_DIR}/icons/${_prefix}/${_theme} COMMAND ${CMAKE_COMMAND} -E remove -f ${_BASE_DIR}/CMakeLists.txt COMMAND ${CMAKE_COMMAND} -E remove -f ${_BASE_DIR}/icons/${_prefix}/${_theme}/files.cmake DEPENDS "${_FILES}" SOURCES "${_FILES}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Copying icon files to ${_BASE_DIR}" VERBATIM ) add_custom_target(${_target}_build_qrc COMMAND ${Qt5Core_RCC_EXECUTABLE} --project -o "${CMAKE_CURRENT_BINARY_DIR}/${_target}.qrc" # avoid adding the .qrc file to rcc due to rcc misfeature COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/${_target}.qrc" "${_QRC_FILE}" DEPENDS "${_FILES}" SOURCES "${_FILES}" WORKING_DIRECTORY "${_BASE_DIR}" COMMENT "Building Qt resource file ${_QRC_FILE}" VERBATIM ) add_dependencies(${_target}_build_qrc ${_target}_copy_icons) add_custom_target(${_target}_build_rcc COMMAND ${Qt5Core_RCC_EXECUTABLE} --compress 9 --threshold 0 --binary --output "${_RCC_FILE}" "${_QRC_FILE}" DEPENDS "${_QRC_FILE}" "${_FILES}" WORKING_DIRECTORY "${_BASE_DIR}" COMMENT "Building external Qt resource ${_RCC_FILE}" VERBATIM ) add_dependencies(${_target}_build_rcc ${_target}_build_qrc) add_dependencies(${_parent_target} ${_target}_build_rcc) install(FILES ${_RCC_FILE} DESTINATION "${ICONS_INSTALL_DIR}" ) add_update_file_target( TARGET update_${_target} COMMAND "${PROJECT_SOURCE_DIR}/cmake/modules/update_icon_list.sh" ${_theme} icons/${_theme}/files.cmake FILE ${_target}_files.cmake SOURCES "${PROJECT_SOURCE_DIR}/cmake/modules/update_icon_list.sh" ) add_dependencies(update_all_rcc update_${_target}) unset(_BASE_DIR) unset(_QRC_FILE) unset(_RCC_FILE) endmacro() # Convenience macro for plugin icons. Icons are places in a path that contains _plugin_target. # For example, icons/org.kde.kreport.barcode/breeze/actions/16/kreport-barcode-element.svg. # This helps to make plugins not conflicting. macro(kreport_add_plugin_icons_rcc_file _plugin_target _theme) kreport_add_icons_rcc_file(${_plugin_target}_${_theme} ${_plugin_target} ${_theme} ${_plugin_target}) endmacro() diff --git a/cmake/modules/KReportMacros.cmake b/cmake/modules/KReportMacros.cmake index 4a74fa99..2da0ec2d 100644 --- a/cmake/modules/KReportMacros.cmake +++ b/cmake/modules/KReportMacros.cmake @@ -1,167 +1,160 @@ # Additional CMake macros # # Copyright (C) 2015-2018 Jarosław Staniek # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if(__kreport_macros) return() endif() set(__kreport_macros YES) include(KDbGenerateHeaders) # from KDb, adds support for generated headers to ECMGenerateHeaders include(KDbCreateSharedDataClasses) # from KDb include(GenerateExportHeader) include(GetGitRevisionDescription) include(KReportAddSimpleOption) string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) string(COMPARE EQUAL "${CMAKE_CXX_COMPILER_ID}" "Clang" CMAKE_COMPILER_IS_CLANG) # Keep apps in the same bin dir so resources that are kept relative to this dir can be found # without installing. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") # x.81.z or larger means test release, so the stable major version is x+1 if(PROJECT_VERSION_MINOR GREATER 80) set(PROJECT_UNSTABLE ON) math(EXPR PROJECT_STABLE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR} + 1") set(PROJECT_STABLE_VERSION_MINOR 0) set(PROJECT_STABLE_VERSION_PATCH 0) # x.y.81 or larger means test release, so the stable minor version is y+1 elseif(PROJECT_VERSION_PATCH GREATER 80) set(PROJECT_STABLE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) math(EXPR PROJECT_STABLE_VERSION_MINOR "${PROJECT_VERSION_MINOR} + 1") set(PROJECT_STABLE_VERSION_PATCH 0) else() set(PROJECT_STABLE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(PROJECT_STABLE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(PROJECT_STABLE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) endif() if(WIN32) set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR} RUNTIME DESTINATION ${BIN_INSTALL_DIR} LIBRARY ${INSTALL_TARGETS_DEFAULT_ARGS} ARCHIVE ${INSTALL_TARGETS_DEFAULT_ARGS} ) - set(DATA_INSTALL_DIR "$ENV{APPDATA}") - STRING(REGEX REPLACE "\\\\" "/" DATA_INSTALL_DIR ${DATA_INSTALL_DIR}) - # Install own icons to CMAKE_INSTALL_FULL_ICONDIR (relative to bin/data/ on Windows) on Windows. - # We're consistent because icons from breeze-icons.git are installed there as well. - set(ICONS_INSTALL_DIR ${CMAKE_INSTALL_FULL_ICONDIR}) -else() - # On other OSes install own icons in app's data dir - set(ICONS_INSTALL_DIR - "${DATA_INSTALL_DIR}/${PROJECT_NAME_LOWER}${PROJECT_STABLE_VERSION_MAJOR}/icons") endif() +set(ICONS_INSTALL_DIR "${DATA_INSTALL_DIR}/${PROJECT_NAME_LOWER}${PROJECT_STABLE_VERSION_MAJOR}/icons") + # Fetches git revision and branch from the source dir of the current build if possible. # Sets ${PROJECT_NAME_UPPER}_GIT_SHA1_STRING and ${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING variables. # If git information is not available but ${CMAKE_SOURCE_DIR}/GIT_VERSION file exists, # it is parsed. This file can be created by scripts while preparing tarballs and is # supposed to contain two lines: hash and branch. macro(get_git_revision_and_branch) set(${PROJECT_NAME_UPPER}_GIT_SHA1_STRING "") set(${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING "") get_git_head_revision(GIT_REFSPEC ${PROJECT_NAME_UPPER}_GIT_SHA1_STRING) get_git_branch(${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING) if(NOT ${PROJECT_NAME_UPPER}_GIT_SHA1_STRING OR NOT ${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING) if(EXISTS "${CMAKE_SOURCE_DIR}/GIT_VERSION") file(READ "${CMAKE_SOURCE_DIR}/GIT_VERSION" _ver) string(REGEX REPLACE "\n" ";" _ver "${_ver}") list(GET _ver 0 ${PROJECT_NAME_UPPER}_GIT_SHA1_STRING) list(GET _ver 1 ${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING) endif() endif() if(${PROJECT_NAME_UPPER}_GIT_SHA1_STRING OR ${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING) string(SUBSTRING ${${PROJECT_NAME_UPPER}_GIT_SHA1_STRING} 0 7 ${PROJECT_NAME_UPPER}_GIT_SHA1_STRING) else() set(${PROJECT_NAME_UPPER}_GIT_SHA1_STRING "") set(${PROJECT_NAME_UPPER}_GIT_BRANCH_STRING "") endif() endmacro() # Adds ${PROJECT_NAME_UPPER}_UNFINISHED option. If it is ON, unfinished features # (useful for testing but may confuse end-user) are compiled-in. # This option is OFF by default. macro(add_unfinished_features_option) simple_option(${PROJECT_NAME_UPPER}_UNFINISHED "Include unfinished features (useful for testing but may confuse end-user)" OFF) endmacro() # Adds commands that generate ${_filename}${PROJECT_STABLE_VERSION_MAJOR}.pc file # out of ${_filename}.pc.cmake file and installs the .pc file to ${LIB_INSTALL_DIR}/pkgconfig. # These commands are not executed for WIN32. # ${CMAKE_SOURCE_DIR}/${_filename}.pc.cmake should exist. macro(add_pc_file _filename) if (NOT WIN32) set(_name ${_filename}${PROJECT_STABLE_VERSION_MAJOR}) configure_file(${CMAKE_SOURCE_DIR}/${_filename}.pc.cmake ${CMAKE_BINARY_DIR}/${_name}.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/${_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) endif() endmacro() # Sets detailed version information for library co-installability. # - adds PROJECT_STABLE_VERSION_MAJOR to the lib name # - sets VERSION to PROJECT_STABLE_VERSION_MAJOR.PROJECT_STABLE_VERSION_MINOR.PROJECT_STABLE_VERSION_PATCH # - sets SOVERSION to PROJECT_STABLE_VERSION_MAJOR # (special case for 3.0 < PROJECT_STABLE_VERSION < 4.0: sets SOVERSION to PROJECT_STABLE_VERSION_MAJOR + 1 # to separate from incompatible version 3.0) # - sets ${_target_upper}_BASE_NAME variable to the final lib name # - sets ${_target_upper}_BASE_NAME_LOWER variable to the final lib name, lowercase # - sets ${_target_upper}_INCLUDE_INSTALL_DIR to include dir for library headers # - (where _target_upper is uppercase ${_target} macro(set_coinstallable_lib_version _target) set(_name ${_target}${PROJECT_STABLE_VERSION_MAJOR}) set(_soversion ${PROJECT_STABLE_VERSION_MAJOR}) if(${PROJECT_STABLE_VERSION_MAJOR} EQUAL 3) math(EXPR _soversion "${PROJECT_STABLE_VERSION_MAJOR} + 1") math(EXPR _version "${PROJECT_STABLE_VERSION_MAJOR} + 1") else() set(_soversion ${PROJECT_STABLE_VERSION_MAJOR}) endif() set(_version "${_version}.${PROJECT_STABLE_VERSION_MINOR}.${PROJECT_STABLE_VERSION_PATCH}") set_target_properties(${_target} PROPERTIES VERSION ${_version} SOVERSION ${_soversion} EXPORT_NAME ${_target} OUTPUT_NAME ${_name} ) string(TOUPPER ${_target} _target_upper) string(TOUPPER ${_target_upper}_BASE_NAME _var) set(${_var} ${_name}) string(TOLOWER ${_name} ${_var}_LOWER) set(${_target_upper}_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/${_name}) unset(_soversion) unset(_version) unset(_target_upper) unset(_var) endmacro() # Adds custom target ${_target} that updates file ${_file} in the current working dir # using command ${_command} and add sources ${_sources} to the project files. # The command is run as a part of the project. function(add_update_file_target) set(options) set(oneValueArgs TARGET FILE) set(multiValueArgs COMMAND SOURCES) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) add_custom_target(${ARG_TARGET} COMMAND ${ARG_COMMAND} SOURCES ${ARG_SOURCES} DEPENDS ${ARG_SOURCES} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Updating ${ARG_FILE}" VERBATIM ) endfunction() # Checks if ${_package} has at most version ${_maximum_version}. macro(check_maximum_package_version _package _maximum_version) if(NOT ${_package}_FOUND OR NOT ${${_package}_VERSION} VERSION_LESS ${_maximum_version}) message(FATAL_ERROR "Maximum version of ${_package} is ${_maximum_version}, " "found ${${_package}_VERSION}") endif() endmacro() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9f89651a..e9e4354a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,372 +1,372 @@ # 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/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/KReportDataSource.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/KReportOneRecordDataSource_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/KReportRuler_p.cpp wrtembed/KReportZoomHandler_p.cpp wrtembed/KReportZoomMode_p.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) add_library(KReportUtilsPrivate STATIC common/KReportUtils_p.cpp ) 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 ${SCRIPTING_LIBS} KReportUtilsPrivate ) target_link_libraries(KReportUtilsPrivate PUBLIC Qt5::Widgets KF5::ConfigGui KF5::WidgetsAddons ) 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}) +set(KREPORT_PLUGIN_INSTALL_DIR ${PLUGIN_INSTALL_DIR}/${PROJECT_NAME_LOWER}${PROJECT_STABLE_VERSION_MAJOR}) 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 KReportDataSource KReportItemBase KReportItemLine KReportPluginMetaData KReportPluginManager KReportPluginInterface KReportUnit KReportUtils KReportDesign 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 KReportGroupTracker KReportScriptConstants KReportScriptDraw KReportScriptHandler KReportScriptSource ) endif() ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE wrtembed HEADER_NAMES KReportDesignerSectionDetail KReportDesignerSection 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 NAME KReport BASE_NAME ${KREPORT_BASE_NAME} VERSION ${PROJECT_VERSION} 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)