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

0001 # SPDX-FileCopyrightText: none
0002 # SPDX-License-Identifier: BSD-3-Clause
0003 include(CheckFunctionExists)
0004 include(CheckIncludeFiles)
0005 include(CheckSymbolExists)
0006 
0007 ecm_setup_version(PROJECT VARIABLE_PREFIX KLDAPCORE
0008                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kldap_core_version.h"
0009                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPim6LdapCoreConfigVersion.cmake"
0010                         SOVERSION 6
0011 )
0012 
0013 
0014 check_include_files(sys/time.h HAVE_SYS_TIME_H)
0015 
0016 set(kldap_EXTRA_LIBS)
0017 
0018 if(Ldap_FOUND)
0019   set(kldap_EXTRA_LIBS Ldap::Ldap)
0020   if(WIN32)
0021     set(kldap_EXTRA_LIBS ${kldap_EXTRA_LIBS} ws2_32)
0022   endif()
0023   set(CMAKE_REQUIRED_INCLUDES lber.h ldap.h)
0024   set(CMAKE_REQUIRED_LIBRARIES Ldap::Ldap)
0025   check_function_exists(ldap_start_tls_s HAVE_LDAP_START_TLS_S)
0026   check_function_exists(ldap_initialize HAVE_LDAP_INITIALIZE)
0027   check_function_exists(ber_memfree HAVE_BER_MEMFREE)
0028   check_function_exists(ldap_unbind_ext HAVE_LDAP_UNBIND_EXT)
0029   check_function_exists(ldap_extended_operation HAVE_LDAP_EXTENDED_OPERATION)
0030   check_function_exists(ldap_extended_operation_s HAVE_LDAP_EXTENDED_OPERATION_S)
0031 endif()
0032 
0033 set(kldap_EXTRA_LIBS ${kldap_EXTRA_LIBS} Sasl2::Sasl2)
0034 
0035 configure_file(kldap_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/kldap_config.h)
0036 
0037 ########### next target ###############
0038 
0039 add_library(KPim6LdapCore)
0040 add_library(KPim6::LdapCore ALIAS KPim6LdapCore)
0041 
0042 target_sources(KPim6LdapCore PRIVATE
0043   ber.cpp
0044   ldif.cpp
0045   ldapurl.cpp
0046   ldapserver.cpp
0047   ldapobject.cpp
0048   ldapconnection.cpp
0049   ldapoperation.cpp
0050   ldapcontrol.cpp
0051   ldapsearch.cpp
0052   ldapdn.cpp
0053   ldif.h
0054   ldapsearch.h
0055   w32-ldap-help.h
0056   ldapurl.h
0057   ldapcontrol.h
0058   ber.h
0059   ldapdefs.h
0060   ldapconnection.h
0061   ldapdn.h
0062   ldapoperation.h
0063   ldapserver.h
0064   ldapobject.h
0065    )
0066  
0067 ecm_qt_declare_logging_category(KPim6LdapCore HEADER ldap_core_debug.h IDENTIFIER LDAP_LOG CATEGORY_NAME org.kde.pim.ldap.core
0068         DESCRIPTION "kpim6ldapcore (kldap)"
0069         OLD_CATEGORY_NAMES log_ldap_core
0070         EXPORT KLDAP
0071     )
0072 
0073 if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
0074     set_target_properties(KPim6LdapCore PROPERTIES UNITY_BUILD ON)
0075 endif()
0076 generate_export_header(KPim6LdapCore BASE_NAME kldap_core)
0077 
0078 
0079 
0080 target_link_libraries(KPim6LdapCore
0081 PRIVATE
0082   KF6::I18n
0083   KF6::ConfigCore
0084   KF6::CoreAddons
0085   KF6::KIOCore
0086   KF6::ConfigGui
0087   ${kldap_EXTRA_LIBS}
0088 )
0089 
0090 target_link_libraries(KPim6LdapCore PRIVATE qt6keychain)
0091 
0092 target_include_directories(KPim6LdapCore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/KPim6/KLDAPCore>")
0093 target_include_directories(KPim6LdapCore PUBLIC "$<BUILD_INTERFACE:${KLdap_SOURCE_DIR}/src/core;${KLdap_BINARY_DIR}/src>")
0094 
0095 set_target_properties(KPim6LdapCore PROPERTIES
0096     VERSION ${KLDAPCORE_VERSION}
0097     SOVERSION ${KLDAPCORE_SOVERSION}
0098     EXPORT_NAME LdapCore
0099 )
0100 
0101 install(TARGETS KPim6LdapCore EXPORT KPim6LdapCoreTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0102 
0103 ########### install files ###############
0104 
0105 ecm_generate_headers(KLdapCore_CamelCase_HEADERS
0106   HEADER_NAMES
0107   Ber
0108   LdapConnection
0109   LdapControl
0110   LdapDN
0111   LdapObject
0112   LdapOperation
0113   LdapSearch
0114   LdapServer
0115   LdapDefs
0116   LdapUrl
0117   Ldif
0118   PREFIX KLDAPCore
0119   REQUIRED_HEADERS KLdapCore_HEADERS
0120 )
0121 
0122 install(FILES
0123     ${CMAKE_CURRENT_BINARY_DIR}/kldap_core_export.h
0124     ${KLdapCore_HEADERS}
0125     DESTINATION ${KDE_INSTALL_INCLUDEDIR}/KPim6/KLDAPCore/kldapcore
0126     COMPONENT Devel
0127 )
0128 
0129 install(FILES
0130     ${KLdapCore_CamelCase_HEADERS}
0131     DESTINATION ${KDE_INSTALL_INCLUDEDIR}/KPim6/KLDAPCore/KLDAPCore/
0132     COMPONENT Devel
0133 )
0134 
0135 if (BUILD_QCH)
0136     ecm_add_qch(
0137         KPim6LdapCore_QCH
0138         NAME KLdapCore
0139         BASE_NAME KPim6LdapCore
0140         VERSION ${PIM_VERSION}
0141         ORG_DOMAIN org.kde
0142 
0143         SOURCES # using only public headers, to cover only public API
0144             ${KLdapCore_HEADERS}
0145         MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
0146         #IMAGE_DIRS "${CMAKE_SOURCE_DIR}/docs/pics"
0147         LINK_QCHS
0148             Qt6Core_QCH
0149         INCLUDE_DIRS
0150             ${CMAKE_CURRENT_BINARY_DIR}
0151         BLANK_MACROS
0152             KLDAP_CORE_EXPORT
0153         TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0154         QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0155         COMPONENT Devel
0156     )
0157 endif()
0158 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KPim6LdapCore")
0159 
0160 
0161 if (BUILD_QCH)
0162     ecm_install_qch_export(
0163             TARGETS KPim6LdapCore_QCH
0164             FILE KPim6LdapCoreQchTargets.cmake
0165         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0166         COMPONENT Devel
0167     )
0168     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KPim6LdapCoreQchTargets.cmake\")")
0169 endif()
0170 
0171 install(EXPORT KPim6LdapCoreTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KPim6LdapCoreTargets.cmake NAMESPACE KPim6::)
0172 
0173 
0174 configure_package_config_file(
0175   "${CMAKE_CURRENT_SOURCE_DIR}/KPimLdapCoreConfig.cmake.in"
0176   "${CMAKE_CURRENT_BINARY_DIR}/KPim6LdapCoreConfig.cmake"
0177   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0178 )
0179 
0180 install(FILES
0181   "${CMAKE_CURRENT_BINARY_DIR}/KPim6LdapCoreConfig.cmake"
0182   "${CMAKE_CURRENT_BINARY_DIR}/KPim6LdapCoreConfigVersion.cmake"
0183   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0184   COMPONENT Devel
0185 )
0186 
0187 install(FILES
0188    ${CMAKE_CURRENT_BINARY_DIR}/kldap_core_version.h
0189    DESTINATION ${KDE_INSTALL_INCLUDEDIR}/KPim6/KLDAPCore
0190    COMPONENT Devel
0191 )
0192 
0193 if(BUILD_TESTING)
0194     add_subdirectory(autotests)
0195 endif()
0196