Warning, /utilities/kgpg/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
0002 
0003 # KDE Application Version, managed by release script
0004 set (RELEASE_SERVICE_VERSION_MAJOR "22")
0005 set (RELEASE_SERVICE_VERSION_MINOR "11")
0006 set (RELEASE_SERVICE_VERSION_MICRO "70")
0007 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 project(kgpg VERSION ${RELEASE_SERVICE_VERSION})
0010 set(QT_MIN_VERSION "5.15.2")
0011 set(KF5_MIN_VERSION "5.90.0")
0012 
0013 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0014 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
0015 
0016 include(KDEInstallDirs)
0017 include(KDECMakeSettings)
0018 include(KDECompilerSettings NO_POLICY_SCOPE)
0019 
0020 include(ECMAddAppIcon)
0021 include(ECMInstallIcons)
0022 include(FeatureSummary)
0023 include(ECMSetupVersion)
0024 include(CMakeFindDependencyMacro)
0025 include(ECMQtDeclareLoggingCategory)
0026 
0027 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
0028   Core
0029   DBus
0030   Gui
0031   PrintSupport
0032   Widgets
0033 )
0034 
0035 # Load the frameworks we need
0036 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
0037   Archive
0038   DocTools
0039   Codecs
0040   CoreAddons
0041   Crash
0042   DBusAddons
0043   I18n
0044   JobWidgets
0045   KIO
0046   Notifications
0047   Service
0048   TextWidgets
0049   XmlGui
0050   WidgetsAddons
0051   WindowSystem
0052 )
0053 
0054 # kdepimlibs
0055 find_package(KF5 REQUIRED
0056   AkonadiContact
0057   Contacts
0058 )
0059 
0060 # only headers are used
0061 find_package(Gpgme REQUIRED)
0062 
0063 add_definitions(
0064     #-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00
0065     -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
0066     -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200
0067     -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
0068 )
0069 
0070 add_subdirectory( icons )
0071 add_subdirectory( doc )
0072 include_directories(  ${KDEPIMLIBS_INCLUDE_DIR} ${GPGME_INCLUDES} )
0073 
0074 option(KGPG_DEBUG_TRANSACTIONS "show commands and results of gpg calls in debug log" Off)
0075 
0076 
0077 
0078 
0079 set(core_SRCS
0080    core/convert.cpp
0081    core/images.cpp
0082    core/emailvalidator.cpp
0083    core/kgpgkey.cpp
0084    core/KGpgExpandableNode.cpp
0085    core/KGpgKeyNode.cpp
0086    core/KGpgGroupMemberNode.cpp
0087    core/KGpgGroupNode.cpp
0088    core/KGpgNode.cpp
0089    core/KGpgOrphanNode.cpp
0090    core/KGpgRefNode.cpp
0091    core/KGpgRootNode.cpp
0092    core/KGpgSignableNode.cpp
0093    core/KGpgSignNode.cpp
0094    core/KGpgSubkeyNode.cpp
0095    core/KGpgUatNode.cpp
0096    core/KGpgUidNode.cpp
0097 )
0098 
0099 set(kgpg_editor_SRCS
0100    editor/kgpgmd5widget.cpp
0101    editor/kgpgeditor.cpp
0102    editor/kgpgtextedit.cpp
0103 )
0104 
0105 set(kgpg_model_SRCS
0106    model/gpgservermodel.cpp
0107    model/kgpgitemmodel.cpp
0108    model/groupeditproxymodel.cpp
0109    model/keylistproxymodel.cpp
0110    model/kgpgsearchresultmodel.cpp
0111    model/selectkeyproxymodel.cpp
0112 )
0113 
0114 set(kgpg_transaction_SRCS
0115    transactions/kgpgtransaction.cpp
0116    transactions/kgpgtransactionjob.cpp
0117    transactions/kgpgtransactionprivate.cpp
0118    transactions/kgpguidtransaction.cpp
0119    transactions/kgpgeditkeytransaction.cpp
0120    transactions/kgpgsigntransactionhelper.cpp
0121    transactions/kgpgchangedisable.cpp
0122    transactions/kgpgchangeexpire.cpp
0123    transactions/kgpgchangepass.cpp
0124    transactions/kgpgchangetrust.cpp
0125    transactions/kgpgdelsign.cpp
0126    transactions/kgpgdeluid.cpp
0127    transactions/kgpgencrypt.cpp
0128    transactions/kgpgexport.cpp
0129    transactions/kgpgaddphoto.cpp
0130    transactions/kgpgadduid.cpp
0131    transactions/kgpggeneratekey.cpp
0132    transactions/kgpggeneraterevoke.cpp
0133    transactions/kgpgdecrypt.cpp
0134    transactions/kgpgdelkey.cpp
0135    transactions/kgpgimport.cpp
0136    transactions/kgpgkeyservertransaction.cpp
0137    transactions/kgpgkeyservergettransaction.cpp
0138    transactions/kgpgkeyserversearchtransaction.cpp
0139    transactions/kgpgprimaryuid.cpp
0140    transactions/kgpgsendkeys.cpp
0141    transactions/kgpgsignkey.cpp
0142    transactions/kgpgsigntext.cpp
0143    transactions/kgpgsignuid.cpp
0144    transactions/kgpgtextorfiletransaction.cpp
0145    transactions/kgpgverify.cpp
0146 )
0147 
0148 set(kgpg_SRCS ${core_SRCS} ${kgpg_editor_SRCS} ${kgpg_model_SRCS} ${kgpg_transaction_SRCS}
0149    selectpublickeydialog.cpp
0150    selectsecretkey.cpp
0151    kgpgoptions.cpp
0152    keysmanager.cpp
0153    kgpg.cpp
0154    kgpgkeygenerate.cpp
0155    kgpginterface.cpp
0156    kgpgtextinterface.cpp
0157    gpgproc.cpp
0158    klinebufferedprocess.cpp
0159    klinebufferedprocessprivate.cpp
0160    keyservers.cpp
0161    detailedconsole.cpp
0162    keyinfodialog.cpp
0163    newkey.cpp
0164    keyexport.cpp
0165    conf_encryption.cpp
0166    kgpgrevokewidget.cpp
0167    keytreeview.cpp
0168    groupedit.cpp
0169    sourceselect.cpp
0170    kgpgchangekey.cpp
0171    kgpgfirstassistant.cpp
0172    kgpgexternalactions.cpp
0173    selectexpirydate.cpp
0174    caff.cpp
0175    foldercompressjob.cpp
0176 )
0177 
0178 ecm_qt_declare_logging_category(kgpg_SRCS HEADER kgpg_general_debug.h IDENTIFIER KGPG_LOG_GENERAL CATEGORY_NAME org.kde.kgpg_general DESCRIPTION "kgpg (general)" EXPORT KGPG)
0179 ecm_qt_declare_logging_category(kgpg_SRCS HEADER kgpg_transactions_debug.h IDENTIFIER KGPG_LOG_TRANSACTIONS CATEGORY_NAME org.kde.kgpg_transactions DESCRIPTION "kgpg (transactions)" EXPORT KGPG)
0180 
0181 set(kgpg_HDRS
0182    caff.h
0183    caff_p.h
0184    conf_encryption.h
0185    detailedconsole.h
0186    foldercompressjob.h
0187    gpgproc.h
0188    groupedit.h
0189    keyexport.h
0190    keyinfodialog.h
0191    keyservers.h
0192    keysmanager.h
0193    keytreeview.h
0194    kgpg.h
0195    kgpgchangekey.h
0196    kgpgexternalactions.h
0197    kgpgfirstassistant.h
0198    kgpginterface.h
0199    kgpgkeygenerate.h
0200    kgpgoptions.h
0201    kgpgrevokewidget.h
0202    kgpgtextinterface.h
0203    klinebufferedprocess.h
0204    newkey.h
0205    selectexpirydate.h
0206    selectpublickeydialog.h
0207    selectsecretkey.h
0208    sourceselect.h
0209 )
0210 
0211 qt_add_dbus_adaptor( kgpg_SRCS org.kde.kgpg.Key.xml keysmanager.h KeysManager)
0212 
0213 qt_add_dbus_interface(kgpg_SRCS org.kde.kgpg.Key.xml kgpg_interface )
0214 
0215 ki18n_wrap_ui(kgpg_SRCS
0216     adduid.ui
0217     conf_gpg.ui
0218     searchres.ui
0219     groupedit.ui
0220     conf_ui2.ui
0221     conf_servers.ui
0222     conf_misc.ui
0223     newkey.ui
0224     keyexport.ui
0225     conf_encryption.ui
0226     kgpgKeyInfo.ui
0227     kgpgkeygenerate.ui
0228     kgpgrevokewidget.ui
0229     keyserver.ui
0230     conf_decryption.ui
0231     sourceselect.ui
0232 )
0233 
0234 file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kgpg.png")
0235 ecm_add_app_icon(kgpg_SRCS ICONS ${ICONS_SRCS})
0236 
0237 kconfig_add_kcfg_files(kgpg_SRCS kgpgsettings.kcfgc )
0238 
0239 add_library(kgpg_lib STATIC ${kgpg_SRCS} ${kgpg_HDRS})
0240 add_executable(kgpg main.cpp)
0241 target_link_libraries(kgpg kgpg_lib)
0242 
0243 if (KGPG_DEBUG_TRANSACTIONS)
0244         set_property(SOURCE ${kgpg_transaction_SRCS} APPEND PROPERTY COMPILE_DEFINITIONS "KGPG_DEBUG_TRANSACTIONS")
0245 endif ()
0246 
0247 set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS "KGPG_VERSION=\"${RELEASE_SERVICE_VERSION}\"")
0248 
0249 target_link_libraries(kgpg_lib
0250     KF5::AkonadiContact
0251     KF5::Archive
0252     KF5::Codecs
0253     KF5::Contacts
0254     KF5::CoreAddons
0255     KF5::Crash
0256     KF5::DBusAddons
0257     KF5::I18n
0258     KF5::JobWidgets
0259     KF5::KIOCore
0260     KF5::KIOFileWidgets
0261     KF5::KIOWidgets
0262     KF5::Notifications
0263     KF5::Service
0264     KF5::TextWidgets
0265     KF5::XmlGui
0266     KF5::WidgetsAddons
0267     KF5::WindowSystem
0268     Qt::PrintSupport
0269 )
0270 
0271 if(BUILD_TESTING)
0272   add_subdirectory(tests)
0273 endif()
0274 
0275 install(TARGETS kgpg  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
0276 
0277 ########### install files ###############
0278 
0279 install( FILES editor/kgpgeditor.rc keysmanager.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kgpg)
0280 install( FILES tips  DESTINATION ${KDE_INSTALL_DATADIR}/kgpg)
0281 install( PROGRAMS org.kde.kgpg.desktop  DESTINATION ${KDE_INSTALL_APPDIR})
0282 install( FILES org.kde.kgpg.appdata.xml  DESTINATION ${KDE_INSTALL_METAINFODIR})
0283 install( FILES kgpg.kcfg  DESTINATION ${KDE_INSTALL_KCFGDIR})
0284 install( FILES org.kde.kgpg.desktop  DESTINATION ${KDE_INSTALL_AUTOSTARTDIR} )
0285 
0286 install( PROGRAMS kgpg_encryptfile.desktop kgpg_encryptfolder.desktop kgpg_viewdecrypted.desktop  DESTINATION ${KDE_INSTALL_DATADIR}/kio/servicemenus )
0287 install( FILES org.kde.kgpg.Key.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
0288 
0289 ecm_install_icons(ICONS
0290     16-apps-kgpg.png
0291     22-apps-kgpg.png
0292     32-apps-kgpg.png
0293     48-apps-kgpg.png
0294     64-apps-kgpg.png
0295     128-apps-kgpg.png
0296     sc-apps-kgpg.svg
0297     DESTINATION ${KDE_INSTALL_ICONDIR}
0298     THEME hicolor
0299 )
0300 
0301 ecm_qt_install_logging_categories(EXPORT KGPG FILE kgpg.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
0302 ki18n_install(po)
0303 kdoctools_install(po)
0304 
0305 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)