Warning, /frameworks/knewstuff/src/core/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: KDE Contributors
0002 # SPDX-License-Identifier: BSD-2-Clause
0003 
0004 set(KNewStuffCore_SRCS
0005     author.cpp
0006     commentsmodel.cpp
0007     cache.cpp
0008     downloadmanager.cpp
0009     engine.cpp
0010     entryinternal.cpp
0011     entrywrapper.cpp
0012     imageloader.cpp
0013     installation.cpp
0014     itemsmodel.cpp
0015     provider.cpp
0016     providersmodel.cpp
0017     security.cpp
0018     tagsfilterchecker.cpp
0019     xmlloader.cpp
0020     errorcode.cpp
0021 
0022     # A system by which queries can be passed to the user, and responses
0023     # gathered, depending on implementation. See question.h for details.
0024     question.cpp
0025     questionmanager.cpp
0026     questionlistener.cpp
0027 
0028     # A set of minimal KJob based classes, designed to replace the
0029     # more powerful KIO based system in places where KIO is not available
0030     # for one reason or another.
0031     jobs/downloadjob.cpp
0032     jobs/filecopyjob.cpp
0033     jobs/filecopyworker.cpp
0034     jobs/httpjob.cpp
0035     jobs/httpworker.cpp
0036 
0037     # A simple wrapper around KPackage operations, which allows for asynchronous interaction
0038     jobs/kpackagejob.cpp
0039 
0040     ../attica/atticaprovider.cpp
0041     ../staticxml/staticxmlprovider.cpp
0042 
0043 
0044 
0045     ../upload/atticahelper.cpp
0046 )
0047 if(KF5Syndication_FOUND)
0048     set(KNewStuffCore_syndication_SRCS
0049         ../opds/opdsprovider.cpp
0050         )
0051 endif()
0052 
0053 ecm_qt_declare_logging_category(KNewStuffCore_SRCS
0054     HEADER knewstuffcore_debug.h
0055     IDENTIFIER KNEWSTUFFCORE
0056     CATEGORY_NAME kf.newstuff.core
0057     OLD_CATEGORY_NAMES org.kde.knewstuff.core
0058     DESCRIPTION "knewstuff (Core Lib)"
0059     EXPORT KNEWSTUFF
0060 )
0061 
0062 add_library(KF5NewStuffCore ${KNewStuffCore_SRCS} ${KNewStuffCore_syndication_SRCS})
0063 add_library(KF5::NewStuffCore ALIAS KF5NewStuffCore )
0064 
0065 ecm_generate_export_header(KF5NewStuffCore
0066     EXPORT_FILE_NAME knewstuffcore_export.h
0067     BASE_NAME KNewStuffCore
0068     GROUP_BASE_NAME KF
0069     VERSION ${KF_VERSION}
0070     DEPRECATED_BASE_VERSION 0
0071     EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
0072     DEPRECATION_VERSIONS 5.31 5.36 5.53 5.71 5.74 5.77 5.83
0073 )
0074 
0075 # The src/ dir is needed for the entry.h header. This only happens because some
0076 # code in Core uses an enum from KNS3::Entry
0077 set(KNewStuffCore_BUILD_INCLUDE_DIRS
0078     ${KNewStuff_BINARY_DIR}
0079     ${CMAKE_CURRENT_BINARY_DIR}
0080     ${CMAKE_BINARY_DIR}/src
0081     ${CMAKE_SOURCE_DIR}/src
0082 )
0083 
0084 target_include_directories(KF5NewStuffCore
0085     PUBLIC "$<BUILD_INTERFACE:${KNewStuffCore_BUILD_INCLUDE_DIRS}>"
0086     INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3>"
0087 )
0088 
0089 target_link_libraries(KF5NewStuffCore
0090   PUBLIC
0091     KF5::Attica                # For interacting with ocs providers, public for uploaddialog slots
0092     KF5::CoreAddons
0093     Qt${QT_MAJOR_VERSION}::Xml
0094   PRIVATE
0095     KF5::Archive               # For decompressing archives
0096     KF5::I18n                  # For translations
0097     KF5::ConfigCore
0098     KF5::Package
0099     Qt${QT_MAJOR_VERSION}::Gui                   # For QImage
0100 )
0101 
0102 if(KF5Syndication_FOUND)
0103     target_compile_definitions(KF5NewStuffCore PRIVATE -DSYNDICATION_FOUND="${KF5Syndication_FOUND}")
0104     target_link_libraries(KF5NewStuffCore
0105         PRIVATE
0106         KF5::Syndication #OPDS
0107     )
0108 endif()
0109 
0110 set_target_properties(KF5NewStuffCore PROPERTIES
0111    VERSION ${KNEWSTUFF_VERSION}
0112    SOVERSION ${KNEWSTUFF_SOVERSION}
0113    EXPORT_NAME NewStuffCore
0114 )
0115 
0116 ecm_generate_headers(KNewStuffCore_CamelCase_HEADERS
0117   HEADER_NAMES
0118   Author
0119   Cache
0120   DownloadManager
0121   Engine
0122   EntryInternal
0123   EntryWrapper
0124   ErrorCode
0125   Installation
0126   ItemsModel
0127   Provider
0128   ProvidersModel
0129   Question
0130   QuestionListener
0131   QuestionManager
0132   Security
0133   TagsFilterChecker
0134   XmlLoader
0135 
0136   REQUIRED_HEADERS KNewStuffCore_HEADERS
0137   OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/KNSCore
0138 )
0139 
0140 install(TARGETS KF5NewStuffCore EXPORT KF5NewStuffCoreTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0141 
0142 install(
0143     FILES
0144         ${KNewStuffCore_CamelCase_HEADERS}
0145         ${KNewStuffCore_HEADERS}
0146         ${CMAKE_CURRENT_BINARY_DIR}/knewstuffcore_export.h
0147     DESTINATION
0148         ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/KNSCore
0149     COMPONENT Devel
0150 )
0151 # Kept for backwards compatibility; in KF6 all headers are going to be in KNewStuff3/KNSCore
0152 if(${QT_MAJOR_VERSION} STREQUAL "5")
0153     install(FILES
0154         ${KNewStuffCore_HEADERS}
0155         ${CMAKE_CURRENT_BINARY_DIR}/knewstuffcore_export.h
0156         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/knscore COMPONENT Devel)
0157 endif()
0158 
0159 if(BUILD_QCH)
0160     ecm_add_qch(
0161         KF5NewStuffCore_QCH
0162         NAME KNewStuffCore
0163         BASE_NAME KF5NewStuffCore
0164         VERSION ${KF_VERSION}
0165         ORG_DOMAIN org.kde
0166         SOURCES ${KNewStuffCore_HEADERS}
0167         LINK_QCHS
0168             KF5Attica_QCH
0169             KF5CoreAddons_QCH
0170         INCLUDE_DIRS
0171             ${KNewStuffCore_BUILD_INCLUDE_DIRS}
0172         BLANK_MACROS
0173             KNEWSTUFFCORE_EXPORT
0174             KNEWSTUFFCORE_DEPRECATED
0175             KNEWSTUFFCORE_DEPRECATED_EXPORT
0176             "KNEWSTUFFCORE_DEPRECATED_VERSION(x, y, t)"
0177         TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0178         QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0179         COMPONENT Devel
0180     )
0181 endif()
0182 
0183 include(ECMGeneratePriFile)
0184 ecm_generate_pri_file(BASE_NAME KNewStuffCore LIB_NAME KF5NewStuffCore DEPS "Attica" FILENAME_VAR COREPRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3)
0185 install(FILES ${COREPRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
0186