Warning, /frameworks/baloo/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # set minimum version requirements
0002 cmake_minimum_required(VERSION 3.16)
0003 set(REQUIRED_QT_VERSION 6.5.0)
0004 set(KF_VERSION "6.0.0") # handled by release scripts
0005 set(KF_DEP_VERSION "5.249.0") # handled by release scripts
0006
0007 # set up project
0008 project(Baloo VERSION ${KF_VERSION})
0009
0010 # set up extra-cmake-modules before trying anything else
0011 include(FeatureSummary)
0012
0013 find_package(ECM ${KF_DEP_VERSION} NO_MODULE)
0014 set_package_properties(ECM
0015 PROPERTIES
0016 TYPE REQUIRED
0017 DESCRIPTION "Extra CMake Modules"
0018 URL "https://commits.kde.org/extra-cmake-modules"
0019 )
0020 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0021
0022 # we found extra-cmake-modules, so use it now
0023 set(CMAKE_MODULE_PATH
0024 "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}
0025 )
0026
0027 include(ECMSetupVersion)
0028
0029 # set up baloo versions
0030 ecm_setup_version(PROJECT
0031 VARIABLE_PREFIX BALOO
0032 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h"
0033 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6BalooConfigVersion.cmake"
0034 SOVERSION 6
0035 )
0036
0037 # include optional and extra cmake stuff
0038 include(ECMGenerateHeaders)
0039 include(CMakePackageConfigHelpers)
0040 include(KDEInstallDirs)
0041 include(KDECMakeSettings)
0042 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0043 include(ECMAddTests)
0044 include(ECMAddQch)
0045 include(ECMQtDeclareLoggingCategory)
0046 include(ECMMarkNonGuiExecutable)
0047 include(ECMGenerateExportHeader)
0048 include(ECMGeneratePkgConfigFile)
0049 include(ECMConfiguredInstall)
0050 include(ECMDeprecationSettings)
0051
0052 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0053
0054 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0055 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0056
0057 option(BUILD_EXPERIMENTAL "Build experimental features" OFF)
0058 add_feature_info(EXP ${BUILD_EXPERIMENTAL} "Build experimental features")
0059
0060 option(BUILD_INDEXER_SERVICE "Build the background indexer service" ON)
0061 add_feature_info(INDEXER_SERVICE ${BUILD_INDEXER_SERVICE}
0062 "Build and install the session wide indexer service. The service is started with the session and running in the background.")
0063
0064 # set up build dependencies
0065 find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus Widgets Qml Quick Test)
0066
0067 find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS CoreAddons Config DBusAddons I18n IdleTime Solid FileMetaData Crash KIO)
0068
0069 find_package(LMDB)
0070 set_package_properties(LMDB
0071 PROPERTIES
0072 DESCRIPTION "Lightning Memory-Mapped Database (LMDB)"
0073 URL "https://symas.com/lmdb"
0074 TYPE REQUIRED
0075 )
0076 if(${LMDB_FOUND})
0077 include_directories(${LMDB_INCLUDE_DIRS})
0078 endif()
0079
0080 # compiler flags and build system
0081 ecm_set_disabled_deprecation_versions(
0082 QT 6.4
0083 KF 5.97
0084 )
0085
0086 find_package(Inotify)
0087 set_package_properties(Inotify PROPERTIES
0088 PURPOSE "Filesystem alteration notifications using inotify")
0089 set(BUILD_KINOTIFY ${Inotify_FOUND})
0090
0091 configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h)
0092
0093 include_directories(
0094 ${CMAKE_BINARY_DIR}
0095 ${CMAKE_SOURCE_DIR}
0096
0097 # we'll configure the rest here so that we don't have to
0098 # specify them in the source and test directories separately
0099 ${CMAKE_SOURCE_DIR}/src/lib
0100 ${CMAKE_BINARY_DIR}/src/lib
0101 ${CMAKE_BINARY_DIR}/src/codecs
0102 ${CMAKE_SOURCE_DIR}/src/codecs
0103 ${CMAKE_BINARY_DIR}/src/engine
0104 ${CMAKE_SOURCE_DIR}/src/engine
0105 ${CMAKE_BINARY_DIR}/src/file
0106 ${CMAKE_SOURCE_DIR}/src/file
0107 ${CMAKE_BINARY_DIR}/src/dbus
0108 ${CMAKE_SOURCE_DIR}/src/dbus
0109 )
0110
0111 # targets
0112 add_subdirectory(src)
0113
0114 if (BUILD_TESTING AND BUILD_KINOTIFY)
0115 add_subdirectory(tests)
0116 add_subdirectory(autotests)
0117 endif()
0118
0119 # i18n
0120 if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
0121 ki18n_install(po)
0122 endif()
0123
0124 # config files
0125 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Baloo")
0126
0127 if (BUILD_QCH)
0128 ecm_install_qch_export(
0129 TARGETS KF6Baloo_QCH
0130 FILE KF6BalooQchTargets.cmake
0131 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0132 COMPONENT Devel
0133 )
0134 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6BalooQchTargets.cmake\")")
0135 endif()
0136
0137 configure_package_config_file(
0138 "${CMAKE_CURRENT_SOURCE_DIR}/KF6BalooConfig.cmake.in"
0139 "${CMAKE_CURRENT_BINARY_DIR}/KF6BalooConfig.cmake"
0140 PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0141 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0142 )
0143
0144 # install targets
0145 install(FILES
0146 "${CMAKE_CURRENT_BINARY_DIR}/KF6BalooConfig.cmake"
0147 "${CMAKE_CURRENT_BINARY_DIR}/KF6BalooConfigVersion.cmake"
0148 DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0149 COMPONENT devel
0150 )
0151
0152 install(EXPORT KF6BalooTargets
0153 NAMESPACE KF6::
0154 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0155 FILE KF6BalooTargets.cmake)
0156
0157 install(FILES
0158 "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h"
0159 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/Baloo
0160 COMPONENT Devel
0161 )
0162
0163 # and we're done
0164 include(ECMFeatureSummary)
0165 ecm_feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)