Warning, /frameworks/knewstuff/src/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 add_subdirectory(core) 0005 0006 set(KNewStuff_SRCS 0007 entry.cpp 0008 button.cpp 0009 knewstuffaction.cpp 0010 kmoretools/kmoretools.cpp 0011 kmoretools/kmoretoolsconfigdialog_p.cpp 0012 kmoretools/kmoretoolsmenufactory.cpp 0013 kmoretools/kmoretoolspresets.cpp 0014 ui/widgetquestionlistener.cpp 0015 uploaddialog.cpp 0016 qtquickdialogwrapper.cpp 0017 ) 0018 # Exclude deprecated classes from the build 0019 if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND 0020 EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.80.0) 0021 list(APPEND KNewStuff_SRCS 0022 downloaddialog.cpp 0023 downloadwidget.cpp 0024 downloadmanager.cpp 0025 ui/entrydetailsdialog.cpp 0026 ui/imagepreviewwidget.cpp 0027 ui/itemsview.cpp 0028 ui/itemsviewdelegate.cpp 0029 ui/itemsgridviewdelegate.cpp 0030 ui/itemsviewbasedelegate.cpp 0031 ui/progressindicator.cpp 0032 ) 0033 endif() 0034 0035 qt_add_resources(KNewStuff_RESOURCES uploaddialog.qrc) 0036 0037 ecm_qt_declare_logging_category(KNewStuff_SRCS 0038 HEADER knewstuff_debug.h 0039 IDENTIFIER KNEWSTUFF 0040 CATEGORY_NAME kf.newstuff 0041 OLD_CATEGORY_NAMES org.kde.knewstuff 0042 DESCRIPTION "knewstuff (knewstuff)" 0043 EXPORT KNEWSTUFF 0044 ) 0045 0046 ki18n_wrap_ui(KNewStuff_SRCS 0047 downloadwidget.ui 0048 kmoretools/ui/kmoretoolsconfigwidget.ui 0049 ) 0050 0051 add_library(KF5NewStuff ${KNewStuff_SRCS} ${KNewStuff_RESOURCES}) 0052 add_library(KF5::NewStuff ALIAS KF5NewStuff) 0053 0054 ecm_generate_export_header(KF5NewStuff 0055 EXPORT_FILE_NAME knewstuff_export.h 0056 BASE_NAME KNewStuff 0057 GROUP_BASE_NAME KF 0058 VERSION ${KF_VERSION} 0059 DEPRECATED_BASE_VERSION 0 0060 EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} 0061 DEPRECATION_VERSIONS 5.29 5.76 5.77 5.78 5.79 5.80 5.82 5.85 5.91 5.94 0062 ) 0063 0064 target_include_directories(KF5NewStuff 0065 PUBLIC "$<BUILD_INTERFACE:${KNewStuff_BINARY_DIR};${CMAKE_CURRENT_BINARY_DIR}>" 0066 INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3>") 0067 0068 target_link_libraries(KF5NewStuff 0069 PUBLIC 0070 KF5::NewStuffCore 0071 KF5::XmlGui # For KActionCollection in knewstuffaction.h 0072 KF5::Service # For KMoreTools 0073 Qt${QT_MAJOR_VERSION}::Widgets 0074 PRIVATE 0075 KF5::KIOCore # For network fetching operations 0076 KF5::KIOGui # For KIO::OpenUrlJob 0077 KF5::JobWidgets # For KDialogJobUiDelegate 0078 KF5::Completion # For KLineEdit in download dialog 0079 KF5::I18n # For translations 0080 KF5::ItemViews # For buttons on download dialog 0081 KF5::IconThemes # For KIcon 0082 Qt${QT_MAJOR_VERSION}::Qml 0083 Qt${QT_MAJOR_VERSION}::Quick 0084 ) 0085 0086 set_target_properties(KF5NewStuff PROPERTIES 0087 VERSION ${KNEWSTUFF_VERSION} 0088 SOVERSION ${KNEWSTUFF_SOVERSION} 0089 EXPORT_NAME NewStuff 0090 ) 0091 0092 set(KNewStuff_HEADERS 0093 knewstuffaction.h 0094 ) 0095 0096 # For KMoreTools: 0097 if(QT_MAJOR_VERSION EQUAL 5) 0098 ecm_generate_headers(KMoreTools_CamelCase_HEADERS 0099 HEADER_NAMES 0100 KMoreTools 0101 KMoreToolsMenuFactory 0102 KMoreToolsPresets 0103 0104 RELATIVE kmoretools 0105 REQUIRED_HEADERS KMoreTools_HEADERS 0106 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/KNS3 0107 ) 0108 install( 0109 FILES ${KMoreTools_CamelCase_HEADERS} 0110 FILES ${KMoreTools_HEADERS} 0111 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/KNS3 0112 COMPONENT Devel 0113 ) 0114 install( 0115 FILES ${KMoreTools_HEADERS} 0116 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/kns3 0117 COMPONENT Devel 0118 ) 0119 endif() 0120 0121 # In KF6 all KMoreTools headers will be only in ${KDE_INSTALL_INCLUDEDIR_KF}/KMoreTools 0122 ecm_generate_headers(KMoreTools_CamelCase_HEADERS 0123 HEADER_NAMES 0124 KMoreTools 0125 KMoreToolsMenuFactory 0126 KMoreToolsPresets 0127 0128 RELATIVE kmoretools 0129 REQUIRED_HEADERS KMoreTools_HEADERS 0130 ) 0131 install( 0132 FILES 0133 ${KMoreTools_CamelCase_HEADERS} 0134 ${KMoreTools_HEADERS} 0135 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KMoreTools 0136 COMPONENT Devel 0137 ) 0138 target_include_directories(KF5NewStuff 0139 INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" 0140 INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KMoreTools>" 0141 ) 0142 # So that '#include "KNS3/knewstuff_export.h"' works in KMoreTools headers during the build 0143 file(COPY ${CMAKE_CURRENT_BINARY_DIR}/knewstuff_export.h 0144 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/KNS3 0145 ) 0146 0147 ecm_generate_headers(KNewStuff_CamelCase_HEADERS 0148 HEADER_NAMES 0149 DownloadDialog 0150 DownloadWidget 0151 DownloadManager 0152 UploadDialog 0153 Entry 0154 Button 0155 QtQuickDialogWrapper 0156 0157 REQUIRED_HEADERS KNewStuff_HEADERS 0158 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/KNS3 0159 ) 0160 0161 install( 0162 FILES 0163 ${KNewStuff_CamelCase_HEADERS} 0164 ${KNewStuff_HEADERS} 0165 ${CMAKE_CURRENT_BINARY_DIR}/knewstuff_export.h 0166 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/KNS3 0167 COMPONENT Devel 0168 ) 0169 0170 install(TARGETS KF5NewStuff EXPORT KF5NewStuffTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) 0171 0172 # Kept for backwards compatibility, in KF6 all headers will be in KNewStuff3/KNS3 only 0173 if(QT_MAJOR_VERSION STREQUAL "5") 0174 install(FILES 0175 ${CMAKE_CURRENT_BINARY_DIR}/knewstuff_export.h 0176 ${KNewStuff_HEADERS} 0177 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff3/kns3 COMPONENT Devel 0178 ) 0179 endif() 0180 0181 if(BUILD_QCH) 0182 ecm_add_qch( 0183 KF5NewStuff_QCH 0184 NAME KNewStuff 0185 BASE_NAME KF5NewStuff 0186 VERSION ${KF_VERSION} 0187 ORG_DOMAIN org.kde 0188 SOURCES # using only public headers, to cover only public API 0189 ${KNewStuff_HEADERS} 0190 ${KMoreTools_HEADERS} 0191 MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" 0192 IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics" 0193 LINK_QCHS 0194 KF5NewStuffCore_QCH 0195 KF5XmlGui_QCH 0196 KF5Service_QCH 0197 Qt5Widgets_QCH 0198 INCLUDE_DIRS 0199 ${CMAKE_CURRENT_BINARY_DIR} 0200 ${KNewStuff_BINARY_DIR} 0201 BLANK_MACROS 0202 KNEWSTUFF_EXPORT 0203 KNEWSTUFF_DEPRECATED 0204 KNEWSTUFF_DEPRECATED_EXPORT 0205 "KNEWSTUFF_DEPRECATED_VERSION(x, y, t)" 0206 "KNEWSTUFF_DEPRECATED_VERSION_BELATED(x, y, xt, yt, t)" 0207 TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} 0208 QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} 0209 COMPONENT Devel 0210 ) 0211 endif() 0212 0213 # after ecm_add_qch, due to KF5NewStuffWidgets_QCH dependency on KF5NewStuff_QCH being declared 0214 add_subdirectory(widgets) 0215 0216 include(ECMGeneratePriFile) 0217 ecm_generate_pri_file(BASE_NAME KNewStuff LIB_NAME KF5NewStuff DEPS "widgets KXmlGui KNewStuffCore" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff) 0218 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) 0219 0220 add_subdirectory(qtquick) 0221 add_subdirectory(tools) 0222 0223 ecm_qt_install_logging_categories( 0224 EXPORT KNEWSTUFF 0225 FILE knewstuff.categories 0226 DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} 0227 )