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

0001 # This file handles all the logic for compiling KAuth's backends
0002 include(ConfigureChecks.cmake)
0003 
0004 # Configure a small file to tell BackendsManager what to use
0005 configure_file(BackendsConfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/BackendsConfig.h)
0006 
0007 set(KAUTH_INSTALL_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR_KF}/KAuth")
0008 set(KAUTHCORE_INSTALL_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR_KF}/KAuthCore")
0009 set(KAUTHWIDGETS_INSTALL_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR_KF}/KAuthWidgets")
0010 
0011 ecm_create_qm_loader(KAuth_QM_LOADER kauth5_qt)
0012 
0013 set(kauthdebug_SRCS)
0014 ecm_qt_declare_logging_category(kauthdebug_SRCS
0015     HEADER kauthdebug.h
0016     IDENTIFIER KAUTH
0017     CATEGORY_NAME kf.auth
0018     OLD_CATEGORY_NAMES kf5.kauth
0019     DESCRIPTION "KAuth"
0020     EXPORT KAUTH
0021 )
0022 
0023 if(NOT KAUTH_BUILD_CODEGENERATOR_ONLY)
0024     add_library(KF5AuthCore)
0025     add_library(KF5::AuthCore ALIAS KF5AuthCore)
0026     set_target_properties(KF5AuthCore PROPERTIES
0027         VERSION     ${KAUTH_VERSION}
0028         SOVERSION   ${KAUTH_SOVERSION}
0029         EXPORT_NAME AuthCore
0030     )
0031 
0032     target_sources(KF5AuthCore PRIVATE
0033         action.cpp
0034         actionreply.cpp
0035         executejob.cpp
0036         AuthBackend.cpp
0037         BackendsManager.cpp
0038         HelperProxy.cpp
0039         helpersupport.cpp
0040         ${kauthdebug_SRCS}
0041         backends/fake/FakeBackend.cpp
0042         backends/fakehelper/FakeHelperProxy.cpp
0043         ${KAuth_QM_LOADER}
0044     )
0045 
0046     ecm_generate_export_header(KF5AuthCore
0047         BASE_NAME KAuthCore
0048         GROUP_BASE_NAME KF
0049         VERSION ${KF_VERSION}
0050         DEPRECATED_BASE_VERSION 0
0051         DEPRECATION_VERSIONS 5.71
0052         EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
0053     )
0054     target_link_libraries(KF5AuthCore PUBLIC Qt${QT_MAJOR_VERSION}::Core KF5::CoreAddons)  # for KJob
0055     target_link_libraries(KF5AuthCore PRIVATE Qt${QT_MAJOR_VERSION}::DBus)
0056 
0057     target_include_directories(KF5AuthCore INTERFACE
0058         "$<INSTALL_INTERFACE:${KAUTHCORE_INSTALL_INCLUDEDIR};${KAUTH_INSTALL_INCLUDEDIR}>"
0059     )
0060     install(TARGETS KF5AuthCore EXPORT KF5AuthTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0061 
0062     ecm_generate_headers(KAuthCore_CamelCase_HEADERS
0063         HEADER_NAMES
0064             Action
0065             ActionReply
0066             ExecuteJob
0067             HelperSupport
0068 
0069         PREFIX KAuth
0070         REQUIRED_HEADERS KAuthCore_HEADERS
0071     )
0072     install(FILES
0073         ${CMAKE_CURRENT_BINARY_DIR}/kauthcore_export.h
0074         ${KAuthCore_HEADERS}
0075         DESTINATION ${KAUTHCORE_INSTALL_INCLUDEDIR}/kauth # C++ namespace
0076         COMPONENT Devel
0077     )
0078     install(FILES
0079         ${KAuthCore_CamelCase_HEADERS}
0080         DESTINATION ${KAUTHCORE_INSTALL_INCLUDEDIR}/KAuth # C++ namespace
0081         COMPONENT Devel
0082     )
0083 
0084     add_library(KF5AuthWidgets)
0085     add_library(KF5::AuthWidgets ALIAS KF5AuthWidgets)
0086     set_target_properties(KF5AuthWidgets PROPERTIES
0087         VERSION     ${KAUTH_VERSION}
0088         SOVERSION   ${KAUTH_SOVERSION}
0089     )
0090     if (QT_MAJOR_VERSION STREQUAL "5")
0091         # backward-compat name
0092         set_target_properties(KF5AuthWidgets PROPERTIES
0093             OUTPUT_NAME KF5Auth
0094             EXPORT_NAME Auth
0095         )
0096     else()
0097         set_target_properties(KF5AuthWidgets PROPERTIES
0098             EXPORT_NAME AuthWidgets
0099         )
0100     endif()
0101 
0102     target_sources(KF5AuthWidgets PRIVATE
0103         ${kauthdebug_SRCS}
0104         objectdecorator.cpp
0105     )
0106 
0107     ecm_generate_export_header(KF5AuthWidgets
0108         BASE_NAME KAuth
0109         GROUP_BASE_NAME KF
0110         VERSION ${KF_VERSION}
0111         DEPRECATED_BASE_VERSION 0
0112         DEPRECATION_VERSIONS 5.92
0113         EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
0114     )
0115 
0116     target_include_directories(KF5AuthWidgets INTERFACE "$<INSTALL_INTERFACE:${KAUTHWIDGETS_INSTALL_INCLUDEDIR}>")
0117 
0118     target_link_libraries(KF5AuthWidgets PUBLIC KF5AuthCore)
0119     target_link_libraries(KF5AuthWidgets PRIVATE Qt${QT_MAJOR_VERSION}::Widgets)
0120 
0121     install(TARGETS KF5AuthWidgets EXPORT KF5AuthTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0122 
0123     ecm_generate_headers(KAuthWidgets_CamelCase_HEADERS
0124         HEADER_NAMES
0125             ObjectDecorator
0126 
0127         PREFIX KAuth
0128         REQUIRED_HEADERS KAuthWidgets_HEADERS
0129     )
0130     install(FILES
0131         ${CMAKE_CURRENT_BINARY_DIR}/kauth_export.h
0132         ${KAuthWidgets_HEADERS}
0133         DESTINATION ${KAUTHWIDGETS_INSTALL_INCLUDEDIR}/kauth # C++ namespace
0134         COMPONENT Devel
0135     )
0136     install(FILES
0137         ${KAuthWidgets_CamelCase_HEADERS}
0138         DESTINATION ${KAUTHWIDGETS_INSTALL_INCLUDEDIR}/KAuth # C++ namespace
0139         COMPONENT Devel
0140     )
0141 
0142     # provide KF6-forward compat import target
0143     if (QT_MAJOR_VERSION STREQUAL "5")
0144         add_library(KF5AuthFutureWidgets INTERFACE)
0145         target_link_libraries(KF5AuthFutureWidgets INTERFACE KF5AuthWidgets)
0146         set_target_properties(KF5AuthFutureWidgets PROPERTIES
0147             EXPORT_NAME AuthWidgets
0148         )
0149         install(TARGETS KF5AuthFutureWidgets EXPORT KF5AuthTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
0150     endif()
0151 
0152     # provide compat headers for old C++ namespace-part-of-filename includes
0153     if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
0154     EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.92.0)
0155 
0156         install(FILES
0157                 compatheaders/KAuth
0158                 compatheaders/kauth.h
0159                 compatheaders/KAuthAction
0160                 compatheaders/kauthaction.h
0161                 compatheaders/KAuthActionReply
0162                 compatheaders/kauthactionreply.h
0163                 compatheaders/KAuthExecuteJob
0164                 compatheaders/kauthexecutejob.h
0165                 compatheaders/KAuthHelperSupport
0166                 compatheaders/kauthhelpersupport.h
0167                 compatheaders/KAuthObjectDecorator
0168                 compatheaders/kauthobjectdecorator.h
0169             DESTINATION ${KAUTH_INSTALL_INCLUDEDIR}
0170             COMPONENT Devel
0171         )
0172     endif()
0173 endif()
0174 
0175 # KAuth policy generator executable
0176 
0177 # Compile only if fake backend has not been selected
0178 
0179 if (NOT "${KAUTH_BACKEND_NAME}" STREQUAL "FAKE")
0180     # KAUTH_POLICY_GEN_SRCS has been generated from ConfigureChecks.cmake
0181     add_executable(kauth-policy-gen ${KAUTH_POLICY_GEN_SRCS})
0182     add_executable(KF5::kauth-policy-gen ALIAS kauth-policy-gen)
0183     if (APPLE)
0184         include(ECMMarkNonGuiExecutable)
0185         ecm_mark_nongui_executable(kauth-policy-gen)
0186     endif ()
0187 
0188     # KAUTH_POLICY_GEN_LIBRARIES has been generated from ConfigureChecks.cmake
0189     target_link_libraries( kauth-policy-gen PRIVATE ${KAUTH_POLICY_GEN_LIBRARIES} )
0190 
0191     install( TARGETS kauth-policy-gen EXPORT KF5AuthToolsTargets DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
0192 endif ()
0193 
0194 # KAuth backend plugin
0195 
0196 if (NOT "${KAUTH_BACKEND_NAME}" STREQUAL "FAKE" AND NOT KAUTH_BUILD_CODEGENERATOR_ONLY)
0197     # KAUTH_BACKEND_SRCS has been set from ConfigureChecks.cmake
0198     # KAuth::AuthBackend is not exported
0199     add_library(kauth_backend_plugin MODULE ${KAUTH_BACKEND_SRCS} AuthBackend.cpp ${kauthdebug_SRCS})
0200     target_link_libraries(kauth_backend_plugin PRIVATE ${KAUTH_BACKEND_LIBS})
0201     set_target_properties(kauth_backend_plugin PROPERTIES PREFIX "")
0202 
0203     install(TARGETS kauth_backend_plugin
0204             LIBRARY DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_BACKEND_PLUGIN_DIR}"
0205             ARCHIVE DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_BACKEND_PLUGIN_DIR}"
0206             RUNTIME DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_BACKEND_PLUGIN_DIR}"
0207     )
0208 endif ()
0209 
0210 # KAuth helper plugin
0211 
0212 if (NOT "${KAUTH_HELPER_BACKEND_NAME}" STREQUAL "FAKE" AND NOT KAUTH_BUILD_CODEGENERATOR_ONLY)
0213     # KAuth::HelperProxy is not exported
0214     add_library(kauth_helper_plugin MODULE ${KAUTH_HELPER_BACKEND_SRCS} HelperProxy.cpp ${kauthdebug_SRCS})
0215     target_link_libraries(kauth_helper_plugin PRIVATE ${KAUTH_HELPER_BACKEND_LIBS})
0216     set_target_properties(kauth_helper_plugin PROPERTIES PREFIX "")
0217     install(TARGETS kauth_helper_plugin
0218             LIBRARY DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_HELPER_PLUGIN_DIR}"
0219             ARCHIVE DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_HELPER_PLUGIN_DIR}"
0220             RUNTIME DESTINATION "${KDE_INSTALL_PLUGINDIR}/${KAUTH_HELPER_PLUGIN_DIR}"
0221     )
0222 endif ()
0223 
0224 ecm_qt_install_logging_categories(
0225     EXPORT KAUTH
0226     FILE kauth.categories
0227     DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0228 )
0229 
0230 if(BUILD_QCH)
0231     ecm_add_qch(
0232         KF5Auth_QCH
0233         NAME KAuth
0234         BASE_NAME KF5Auth
0235         VERSION ${KF_VERSION}
0236         ORG_DOMAIN org.kde
0237         SOURCES # using only public headers, to cover only public API
0238             ${KAuthCore_HEADERS}
0239             ${KAuthWidgets_HEADERS}
0240         MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
0241         LINK_QCHS
0242             Qt5Core_QCH
0243             KF5CoreAddons_QCH
0244         INCLUDE_DIRS
0245             ${CMAKE_CURRENT_BINARY_DIR}
0246         EXAMPLE_DIRS
0247             ${CMAKE_SOURCE_DIR}/examples
0248         BLANK_MACROS
0249             KAUTHCORE_EXPORT
0250             KAUTH_EXPORT
0251             KAUTH_DEPRECATED
0252             KAUTH_DEPRECATED_EXPORT
0253             "KAUTHCORE_DEPRECATED_VERSION(x, y, t)"
0254             "KAUTHCORE_DEPRECATED_VERSION_BELATED(x, y, xt, yt, t)"
0255         TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0256         QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0257         COMPONENT Devel
0258     )
0259 endif()
0260 
0261 include(ECMGeneratePriFile)
0262 ecm_generate_pri_file(
0263     BASE_NAME KAuthCore
0264     LIB_NAME KF5AuthCore
0265     DEPS "core KCoreAddons"
0266     FILENAME_VAR PRI_FILENAME
0267     INCLUDE_INSTALL_DIRS
0268         ${KAUTHCORE_INSTALL_INCLUDEDIR}
0269         ${KAUTH_INSTALL_INCLUDEDIR}
0270 )
0271 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
0272 ecm_generate_pri_file(
0273     BASE_NAME KAuth
0274     LIB_NAME KF5Auth
0275     DEPS "KAuthCore"
0276     FILENAME_VAR PRI_FILENAME
0277     INCLUDE_INSTALL_DIRS ${KAUTHWIDGETS_INSTALL_INCLUDEDIR}
0278 )
0279 install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})