Warning, /frameworks/kwallet/src/api/KWallet/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 
0002 include(ECMGenerateHeaders)
0003 
0004 ecm_setup_version(${KF_VERSION} VARIABLE_PREFIX KWALLET
0005                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kwallet_version.h"
0006                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6WalletConfigVersion.cmake"
0007                         SOVERSION 6)
0008 
0009 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kwallet_version.h
0010         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KWallet COMPONENT Devel
0011 )
0012 
0013 if(APPLE)
0014     option(MAC_USE_OSXKEYCHAIN "On OS X, use the keychain as backend for kwallet, instead of kwalletd.")
0015 else()
0016     set(MAC_USE_OSXKEYCHAIN FALSE)
0017 endif()
0018 
0019 add_library(KF6Wallet)
0020 add_library(KF6::Wallet ALIAS KF6Wallet)
0021 
0022 set_target_properties(KF6Wallet PROPERTIES
0023     VERSION     ${KWALLET_VERSION}
0024     SOVERSION   ${KWALLET_SOVERSION}
0025     EXPORT_NAME Wallet
0026 )
0027 
0028 if (MAC_USE_OSXKEYCHAIN)
0029     find_library(COREFOUNDATION_LIBRARY CoreFoundation)
0030     find_library(SECURITY_LIBRARY Security)
0031     target_sources(KF6Wallet PRIVATE
0032         kwallet_mac.cpp
0033     )
0034 else()
0035     set(kwallet_dbus_SRCS)
0036     if (NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
0037         EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.72.0)
0038         set(kwallet_xml org.kde.KWallet.xml)
0039     else()
0040         # copy of org.kde.KWallet.xml, but with all deprecated API removed
0041         set(kwallet_xml org.kde.KWallet.nodeprecated.xml)
0042     endif()
0043     qt_add_dbus_interface(kwallet_dbus_SRCS ${kwallet_xml} kwallet_interface)
0044     target_sources(KF6Wallet PRIVATE
0045         kwallet.cpp
0046         ${kwallet_dbus_SRCS}
0047     )
0048 endif()
0049 
0050 ecm_qt_declare_logging_category(KF6Wallet
0051     HEADER kwallet_api_debug.h
0052     IDENTIFIER KWALLET_API_LOG
0053     CATEGORY_NAME kf.wallet.api
0054     OLD_CATEGORY_NAMES kf5.kwallet.api
0055     DESCRIPTION "kwallet api"
0056     EXPORT KWALLET
0057 )
0058 
0059 ecm_generate_export_header(KF6Wallet
0060     BASE_NAME KWallet
0061     GROUP_BASE_NAME KF
0062     VERSION ${KF_VERSION}
0063     USE_VERSION_HEADER
0064     DEPRECATED_BASE_VERSION 0
0065     DEPRECATION_VERSIONS 5.72
0066     EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
0067 )
0068 
0069 target_include_directories(KF6Wallet INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KWallet>")
0070 
0071 target_link_libraries(KF6Wallet
0072     PUBLIC
0073         Qt6::Gui
0074     PRIVATE
0075         Qt6::DBus
0076         Qt6::Widgets
0077         KF6::ConfigCore   # used to store the wallet to be used
0078 )
0079 
0080 if(MAC_USE_OSXKEYCHAIN)
0081    target_link_libraries(KF6Wallet PRIVATE ${CARBON_LIBRARY}
0082                                            ${SECURITY_LIBRARY}
0083                                            ${COREFOUNDATION_LIBRARY})
0084 elseif(APPLE)
0085     target_link_libraries(KF6Wallet PRIVATE ${CARBON_LIBRARY})
0086 else()
0087     target_link_libraries(KF6Wallet PRIVATE Qt6::DBus)
0088     install(FILES ${kwallet_xml} DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} RENAME kf6_org.kde.KWallet.xml)
0089 endif()
0090 
0091 ecm_generate_headers(KWallet_HEADERS
0092   HEADER_NAMES
0093   KWallet
0094 
0095   REQUIRED_HEADERS KWallet_HEADERS
0096 )
0097 
0098 install(TARGETS KF6Wallet EXPORT KF6WalletTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0099 install(FILES
0100   ${CMAKE_CURRENT_BINARY_DIR}/kwallet_export.h
0101   ${KWallet_HEADERS}
0102   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KWallet COMPONENT Devel
0103 )
0104 
0105 if(BUILD_QCH)
0106     ecm_add_qch(
0107         KF6Wallet_QCH
0108         NAME KWallet
0109         BASE_NAME KF6Wallet
0110         VERSION ${KF_VERSION}
0111         ORG_DOMAIN org.kde
0112         SOURCES # using only public headers, to cover only public API
0113             ${KWallet_HEADERS}
0114         LINK_QCHS
0115             Qt6Gui_QCH
0116         INCLUDE_DIRS
0117             ${CMAKE_CURRENT_BINARY_DIR}
0118         BLANK_MACROS
0119             KWALLET_EXPORT
0120             KWALLET_DEPRECATED
0121             KWALLET_DEPRECATED_EXPORT
0122             "KWALLET_DEPRECATED_VERSION(x, y, t)"
0123         TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0124         QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0125         COMPONENT Devel
0126     )
0127 endif()
0128 
0129 
0130 # create a Config.cmake and a ConfigVersion.cmake file and install them
0131 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Wallet")
0132 
0133 if (BUILD_QCH)
0134     ecm_install_qch_export(
0135         TARGETS KF6Wallet_QCH
0136         FILE KF6WalletQchTargets.cmake
0137         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0138         COMPONENT Devel
0139     )
0140     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6WalletQchTargets.cmake\")")
0141 endif()
0142 
0143 include(CMakePackageConfigHelpers)
0144 
0145 configure_package_config_file(
0146   "${CMAKE_CURRENT_SOURCE_DIR}/KF6WalletConfig.cmake.in"
0147   "${CMAKE_CURRENT_BINARY_DIR}/KF6WalletConfig.cmake"
0148   PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0149   PATH_VARS KDE_INSTALL_BINDIR
0150   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0151 )
0152 
0153 install(FILES
0154   "${CMAKE_CURRENT_BINARY_DIR}/KF6WalletConfig.cmake"
0155   "${CMAKE_CURRENT_BINARY_DIR}/KF6WalletConfigVersion.cmake"
0156   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0157   COMPONENT Devel
0158 )
0159 
0160 install(EXPORT KF6WalletTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6WalletTargets.cmake NAMESPACE KF6:: )
0161