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

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 set(KF_VERSION "6.0.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.249.0") # handled by release scripts
0005 project(KDocTools VERSION ${KF_VERSION})
0006 
0007 # ECM setup
0008 include(FeatureSummary)
0009 find_package(ECM 5.249.0  NO_MODULE)
0010 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0011 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0012 
0013 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
0014 
0015 include(KDEInstallDirs)
0016 include(KDECMakeSettings)
0017 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0018 
0019 include(KDEGitCommitHooks)
0020 include(ECMSetupVersion)
0021 include(ECMMarkNonGuiExecutable)
0022 include(ECMQtDeclareLoggingCategory)
0023 include(ECMDeprecationSettings)
0024 include(CMakePackageConfigHelpers)
0025 include(ECMGenerateExportHeader)
0026 include(ECMAddQch)
0027 
0028 set(kdoctools_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/kdoctools_version.h")
0029 ecm_setup_version(PROJECT VARIABLE_PREFIX KDOCTOOLS
0030                         VERSION_HEADER "${kdoctools_version_header}"
0031                         PACKAGE_VERSION_FILE "${CMAKE_BINARY_DIR}/cmake/KF6DocToolsConfigVersion.cmake"
0032                         SOVERSION 6)
0033 
0034 option(MEINPROC_NO_KARCHIVE "Compile meinproc without KArchive dependency. Only for internal usage on KDE infrastructure." OFF)
0035 option(INSTALL_INTERNAL_TOOLS "Install internal tools too." OFF)
0036 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0037 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0038 
0039 # Dependencies
0040 set(REQUIRED_QT_VERSION 6.5.0)
0041 find_package(Qt6Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
0042 
0043 # KF6 frameworks
0044 if (NOT MEINPROC_NO_KARCHIVE)
0045    find_package(KF6Archive ${KF_DEP_VERSION} REQUIRED)
0046 else()
0047    message(WARNING "KArchive dependency has been disabled. This should be done only for internal usage on KDE infrastructure.")
0048 endif()
0049 
0050 find_package(KF6I18n ${KF_DEP_VERSION})
0051 set_package_properties(KF6I18n PROPERTIES TYPE OPTIONAL
0052    PURPOSE "Required to build the KDocTools translations")
0053 
0054 find_package(LibXslt)
0055 set_package_properties(LibXslt PROPERTIES
0056                        URL "http://xmlsoft.org/XSLT"
0057                        TYPE REQUIRED
0058                        PURPOSE "Required by the KDE help system to process DocBook XML"
0059                       )
0060 
0061 find_package(LibXml2)
0062 set_package_properties(LibXml2 PROPERTIES
0063                        URL "http://xmlsoft.org"
0064                        TYPE REQUIRED
0065                        PURPOSE "Required by the KDE help system to process DocBook XML"
0066                       )
0067 
0068 if (NOT LIBXML2_XMLLINT_EXECUTABLE)
0069    message(FATAL_ERROR "xmllint is required to process DocBook XML")
0070 endif()
0071 
0072 find_package(DocBookXML4 "4.5")
0073 
0074 set_package_properties(DocBookXML4 PROPERTIES
0075                        TYPE REQUIRED
0076                        PURPOSE "Required by the KDE help system to process DocBook XML"
0077                       )
0078 
0079 find_package(DocBookXSL)
0080 set_package_properties(DocBookXSL PROPERTIES
0081                        TYPE REQUIRED
0082                        PURPOSE "Required by the KDE help system to process DocBook XML"
0083                       )
0084 
0085 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
0086 set(_kdoctoolsBootStrapping TRUE)
0087 set(KDOCTOOLS_CUSTOMIZATION_DIR "${CMAKE_CURRENT_BINARY_DIR}/src/customization/")
0088 if (WIN32)
0089     set(KDOCTOOLS_MEINPROC_EXECUTABLE          ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc6 )
0090 else ()
0091     set(KDOCTOOLS_MEINPROC_EXECUTABLE          ${CMAKE_CURRENT_BINARY_DIR}/src/meinproc6${CMAKE_EXECUTABLE_SUFFIX} )
0092 endif ()
0093 include(KF6DocToolsMacros.cmake)
0094 
0095 set(KDOCTOOLS_LANGUAGES_LIST af bg ca ca@valencia cs da de el en-GB en eo es et fi fo fr gl he hu id it ja ko lt nds nl nn no pl pt-BR pt ro ru sk sl sq sr sr@latin sr@ijekavian sr@ijekavianlatin sv th tr uk wa xh xx zh-CN zh-TW)
0096 
0097 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6DocTools")
0098 add_definitions(-DTRANSLATION_DOMAIN=\"kdoctools6\")
0099 ecm_set_disabled_deprecation_versions(
0100     QT 6.5
0101     KF 5.102
0102 )
0103 
0104 if (KF6I18n_FOUND)
0105     ki18n_install(po)
0106     kdoctools_install(po)
0107 endif()
0108 add_subdirectory(common)
0109 add_subdirectory(docs)
0110 add_subdirectory(src)
0111 if (BUILD_TESTING)
0112     add_subdirectory(autotests)
0113 endif()
0114 
0115 install(EXPORT KF6DocToolsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6DocToolsTargets.cmake NAMESPACE KF6:: )
0116 install(EXPORT KF6DocToolsToolsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6DocToolsToolsTargets.cmake NAMESPACE KF6:: )
0117 install(
0118     FILES ${kdoctools_version_header}
0119     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KDocTools
0120     COMPONENT Devel
0121 )
0122 
0123 if (BUILD_QCH)
0124     ecm_install_qch_export(
0125         TARGETS KF6DocTools_QCH
0126         FILE "${CMAKE_BINARY_DIR}/cmake/KF6DocToolsQchTargets.cmake"
0127         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0128         COMPONENT Devel
0129     )
0130     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6DocToolsQchTargets.cmake\")")
0131 endif()
0132 
0133 configure_package_config_file(
0134   "${CMAKE_CURRENT_SOURCE_DIR}/KF6DocToolsConfig.cmake.in"
0135   "${CMAKE_BINARY_DIR}/cmake/KF6DocToolsConfig.cmake"
0136   PATH_VARS
0137     KDE_INSTALL_DATADIR_KF
0138   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0139 )
0140 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/KF6DocToolsMacros.cmake ${CMAKE_BINARY_DIR}/cmake/KF6DocToolsMacros.cmake COPYONLY)
0141 # we need a separate copy with local paths for install autotests
0142 export(EXPORT KF6DocToolsTargets FILE ${CMAKE_BINARY_DIR}/cmake/KF6DocToolsTargets.cmake NAMESPACE KF6::)
0143 export(EXPORT KF6DocToolsToolsTargets FILE ${CMAKE_BINARY_DIR}/cmake/KF6DocToolsToolsTargets.cmake NAMESPACE KF6::)
0144 
0145 install(FILES
0146   "${CMAKE_BINARY_DIR}/cmake/KF6DocToolsConfig.cmake"
0147   "${CMAKE_BINARY_DIR}/cmake/KF6DocToolsConfigVersion.cmake"
0148   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0149   COMPONENT Devel
0150 )
0151 
0152 configure_file(config-kdoctools.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdoctools.h )
0153 
0154 install( FILES
0155     KF6DocToolsMacros.cmake
0156     DESTINATION ${CMAKECONFIG_INSTALL_DIR} COMPONENT Devel )
0157 
0158 include(ECMFeatureSummary)
0159 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0160 
0161 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)