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 5.15.2)
0004 set(KF_VERSION "5.116.0") # handled by release scripts
0005 set(KF_DEP_VERSION "5.115.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}/KF5BalooConfigVersion.cmake"
0034     SOVERSION 5
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(ECMConfiguredInstall)
0049 include(ECMDeprecationSettings)
0050 
0051 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0052 
0053 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0054 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0055 
0056 option(BUILD_EXPERIMENTAL "Build experimental features" OFF)
0057 add_feature_info(EXP ${BUILD_EXPERIMENTAL} "Build experimental features")
0058 
0059 option(BUILD_INDEXER_SERVICE "Build the background indexer service" ON)
0060 add_feature_info(INDEXER_SERVICE ${BUILD_INDEXER_SERVICE}
0061     "Build and install the session wide indexer service. The service is started with the session and running in the background.")
0062 
0063 # set up build dependencies
0064 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus Widgets Qml Quick Test)
0065 if (QT_MAJOR_VERSION STREQUAL "6")
0066     find_package(Qt6Core5Compat)
0067 endif()
0068 
0069 find_package(KF5 ${KF_DEP_VERSION} REQUIRED COMPONENTS CoreAddons Config DBusAddons I18n IdleTime Solid FileMetaData Crash KIO)
0070 
0071 find_package(LMDB)
0072 set_package_properties(LMDB
0073     PROPERTIES
0074         DESCRIPTION "Lightning Memory-Mapped Database (LMDB)"
0075         URL "https://symas.com/lmdb"
0076         TYPE REQUIRED
0077 )
0078 if(${LMDB_FOUND})
0079     include_directories(${LMDB_INCLUDE_DIRS})
0080 endif()
0081 
0082 # compiler flags and build system
0083 ecm_set_disabled_deprecation_versions(
0084     QT 5.15.2
0085     KF 5.97
0086 )
0087 
0088 find_package(Inotify)
0089 set_package_properties(Inotify PROPERTIES
0090     PURPOSE "Filesystem alteration notifications using inotify")
0091 set(BUILD_KINOTIFY ${Inotify_FOUND})
0092 
0093 configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h)
0094 
0095 include_directories(
0096     ${CMAKE_BINARY_DIR}
0097     ${CMAKE_SOURCE_DIR}
0098 
0099     # we'll configure the rest here so that we don't have to
0100     # specify them in the source and test directories separately
0101     ${CMAKE_SOURCE_DIR}/src/lib
0102     ${CMAKE_BINARY_DIR}/src/lib
0103     ${CMAKE_BINARY_DIR}/src/codecs
0104     ${CMAKE_SOURCE_DIR}/src/codecs
0105     ${CMAKE_BINARY_DIR}/src/engine
0106     ${CMAKE_SOURCE_DIR}/src/engine
0107     ${CMAKE_BINARY_DIR}/src/file
0108     ${CMAKE_SOURCE_DIR}/src/file
0109     ${CMAKE_BINARY_DIR}/src/dbus
0110     ${CMAKE_SOURCE_DIR}/src/dbus
0111 )
0112 
0113 # targets
0114 add_subdirectory(src)
0115 
0116 if (BUILD_TESTING AND BUILD_KINOTIFY)
0117    add_subdirectory(tests)
0118    add_subdirectory(autotests)
0119 endif()
0120 
0121 # i18n
0122 if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
0123    ki18n_install(po)
0124 endif()
0125 
0126 # config files
0127 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Baloo")
0128 
0129 if (BUILD_QCH)
0130     ecm_install_qch_export(
0131         TARGETS KF5Baloo_QCH
0132         FILE KF5BalooQchTargets.cmake
0133         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0134         COMPONENT Devel
0135     )
0136     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5BalooQchTargets.cmake\")")
0137 endif()
0138 
0139 configure_package_config_file(
0140     "${CMAKE_CURRENT_SOURCE_DIR}/KF5BalooConfig.cmake.in"
0141     "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfig.cmake"
0142     PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0143     INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0144 )
0145 
0146 # install targets
0147 install(FILES
0148     "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfig.cmake"
0149     "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake"
0150     DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0151     COMPONENT devel
0152 )
0153 
0154 install(EXPORT KF5BalooTargets
0155     NAMESPACE KF5::
0156     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0157     FILE KF5BalooTargets.cmake)
0158 
0159 install(FILES
0160     "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h"
0161     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/Baloo
0162     COMPONENT Devel
0163 )
0164 
0165 # and we're done
0166 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)