diff --git a/CMakeLists.txt b/CMakeLists.txt index 3973d9ae..b16360af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,151 +1,152 @@ # set minimum version requirements cmake_minimum_required(VERSION 3.0) set(REQUIRED_QT_VERSION 5.7.0) set(KF5_VERSION "5.43.0") # handled by release scripts set(KF5_DEP_VERSION "5.42.0") # handled by release scripts # set up project project(Baloo VERSION ${KF5_VERSION}) # set up extra-cmake-modules before trying anything else include(FeatureSummary) find_package(ECM ${KF5_DEP_VERSION} NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules" URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules" ) feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) # we found extra-cmake-modules, so use it now set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ) include(ECMSetupVersion) # set up baloo versions ecm_setup_version(PROJECT VARIABLE_PREFIX BALOO VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake" SOVERSION 5 ) # include optional and extra cmake stuff include(GenerateExportHeader) include(ECMGenerateHeaders) include(CMakePackageConfigHelpers) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMAddTests) include(ECMAddQch) include(ECMQtDeclareLoggingCategory) +include(ECMMarkNonGuiExecutable) option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") # set up build dependencies find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus Widgets Qml Quick Test) find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS CoreAddons Config DBusAddons I18n IdleTime Solid FileMetaData Crash KIO) find_package(LMDB) set_package_properties(LMDB PROPERTIES DESCRIPTION "Lightning Memory-Mapped Database (LMDB)" URL "http://symas.com/mdb" TYPE REQUIRED ) if(${LMDB_FOUND}) include_directories(${LMDB_INCLUDE_DIRS}) endif() # compiler flags and build system add_definitions(-DQT_NO_KEYWORDS) remove_definitions(-DQT_NO_CAST_FROM_ASCII) find_package(Inotify) set_package_properties(Inotify PROPERTIES PURPOSE "Filesystem alteration notifications using inotify") set(BUILD_KINOTIFY ${Inotify_FOUND}) include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} # we'll configure the rest here so that we don't have to # specify them in the source and test directories separately ${CMAKE_SOURCE_DIR}/src/lib ${CMAKE_BINARY_DIR}/src/lib ${CMAKE_BINARY_DIR}/src/codecs ${CMAKE_SOURCE_DIR}/src/codecs ${CMAKE_BINARY_DIR}/src/engine ${CMAKE_SOURCE_DIR}/src/engine ${CMAKE_BINARY_DIR}/src/file ${CMAKE_SOURCE_DIR}/src/file ${CMAKE_BINARY_DIR}/src/dbus ${CMAKE_SOURCE_DIR}/src/dbus ) # targets add_subdirectory(src) add_subdirectory(icons) if (BUILD_TESTING AND BUILD_KINOTIFY) add_subdirectory(tests) add_subdirectory(autotests) endif() # i18n if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() # config files set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5Baloo") if (BUILD_QCH) ecm_install_qch_export( TARGETS KF5Baloo_QCH FILE KF5BalooQchTargets.cmake DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5BalooQchTargets.cmake\")") endif() configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5BalooConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfig.cmake" PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) # install targets install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5BalooConfigVersion.cmake" DESTINATION ${CMAKECONFIG_INSTALL_DIR} COMPONENT devel ) install(EXPORT KF5BalooTargets NAMESPACE KF5:: DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5BalooTargets.cmake) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/baloo_version.h" DESTINATION ${KF5_INCLUDE_INSTALL_DIR} COMPONENT Devel ) install(FILES baloo.categories DESTINATION ${KDE_INSTALL_CONFDIR}) # and we're done feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/file/CMakeLists.txt b/src/file/CMakeLists.txt index de4dc85c..ef80b784 100644 --- a/src/file/CMakeLists.txt +++ b/src/file/CMakeLists.txt @@ -1,73 +1,74 @@ include_directories(${Inotify_INCLUDE_DIRS}) add_definitions(-DTRANSLATION_DOMAIN=\"baloo_file5\") set(file_static_lib_SRCS # File Indexer mainhub.cpp mainadaptor.cpp fileindexerconfig.cpp basicindexingjob.cpp powerstatemonitor.cpp fileindexscheduler.cpp firstrunindexer.cpp newfileindexer.cpp xattrindexer.cpp modifiedfileindexer.cpp unindexedfileindexer.cpp filecontentindexer.cpp filecontentindexerprovider.cpp extractorprocess.cpp timeestimator.cpp indexcleaner.cpp # Common priority.cpp regexpcache.cpp fileexcludefilters.cpp storagedevices.cpp filtereddiriterator.cpp unindexedfileiterator.cpp migrator.cpp fileinfo.cpp # File Watcher filewatch.cpp pendingfilequeue.cpp metadatamover.cpp pendingfile.cpp kinotify.cpp ) ecm_qt_declare_logging_category(file_static_lib_SRCS HEADER baloodebug.h IDENTIFIER BALOO CATEGORY_NAME org.kde.baloo) add_library(baloofilecommon STATIC ${file_static_lib_SRCS}) target_link_libraries(baloofilecommon Qt5::DBus KF5::I18n KF5::Solid KF5::FileMetaData KF5::Crash KF5::ConfigCore KF5::BalooEngine ${Inotify_LIBRARIES} ) set(file_SRCS main.cpp ) add_executable(baloo_file ${file_SRCS}) +ecm_mark_nongui_executable(baloo_file) target_compile_definitions(baloo_file PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_link_libraries(baloo_file baloofilecommon ) install(TARGETS baloo_file ${INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES baloo_file.desktop DESTINATION ${AUTOSTART_INSTALL_DIR}) add_subdirectory(extractor) diff --git a/src/file/extractor/CMakeLists.txt b/src/file/extractor/CMakeLists.txt index c9c9e4fe..421f2bf1 100644 --- a/src/file/extractor/CMakeLists.txt +++ b/src/file/extractor/CMakeLists.txt @@ -1,39 +1,40 @@ remove_definitions(-DTRANSLATION_DOMAIN=\"baloo_file5\") add_definitions(-DTRANSLATION_DOMAIN=\"baloo_file_extractor5\") set(EXTRACTOR_SRCS main.cpp app.cpp result.cpp iohandler.cpp idlestatemonitor.cpp ../priority.cpp ../basicindexingjob.cpp ../fileindexerconfig.cpp ../storagedevices.cpp ../regexpcache.cpp ../fileexcludefilters.cpp ) ecm_qt_declare_logging_category(EXTRACTOR_SRCS HEADER baloodebug.h IDENTIFIER BALOO CATEGORY_NAME org.kde.baloo) add_executable(baloo_file_extractor ${EXTRACTOR_SRCS}) +ecm_mark_nongui_executable(baloo_file_extractor) target_compile_definitions(baloo_file_extractor PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_link_libraries(baloo_file_extractor Qt5::DBus Qt5::Widgets KF5::FileMetaData KF5::I18n KF5::ConfigCore KF5::Solid KF5::BalooEngine KF5::Crash KF5::IdleTime ) install(TARGETS baloo_file_extractor DESTINATION ${BIN_INSTALL_DIR}) if(BUILD_TESTING) add_subdirectory(autotests) endif() diff --git a/src/tools/balooctl/CMakeLists.txt b/src/tools/balooctl/CMakeLists.txt index d7be2389..f13c4467 100644 --- a/src/tools/balooctl/CMakeLists.txt +++ b/src/tools/balooctl/CMakeLists.txt @@ -1,38 +1,39 @@ add_definitions(-DTRANSLATION_DOMAIN=\"balooctl5\") set(SRCS main.cpp indexer.cpp command.cpp configcommand.cpp statuscommand.cpp monitorcommand.cpp ${CMAKE_SOURCE_DIR}/src/file/extractor/result.cpp ) set(DBUS_INTERFACES ${CMAKE_BINARY_DIR}/src/dbus/maininterface.cpp ${CMAKE_BINARY_DIR}/src/dbus/schedulerinterface.cpp ${CMAKE_BINARY_DIR}/src/dbus/fileindexerinterface.cpp ) # CMake <= 3.9 skipped automoc for generated files # CMake >= 3.10 requires SKIP_AUTOMOC to actually skip automoc SET_SOURCE_FILES_PROPERTIES(${DBUS_INTERFACES} PROPERTIES GENERATED 1 SKIP_AUTOMOC 1) add_executable(balooctl ${SRCS} ${DBUS_INTERFACES}) +ecm_mark_nongui_executable(balooctl) add_dependencies(balooctl BalooDBusInterfaces) target_compile_definitions(balooctl PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_link_libraries(balooctl Qt5::DBus KF5::CoreAddons KF5::ConfigCore KF5::I18n KF5::Baloo KF5::BalooEngine baloofilecommon ) install(TARGETS balooctl DESTINATION ${BIN_INSTALL_DIR}) diff --git a/src/tools/baloosearch/CMakeLists.txt b/src/tools/baloosearch/CMakeLists.txt index 1030a988..a216e3fc 100644 --- a/src/tools/baloosearch/CMakeLists.txt +++ b/src/tools/baloosearch/CMakeLists.txt @@ -1,14 +1,15 @@ add_definitions(-DTRANSLATION_DOMAIN=\"baloosearch5\") set(BALOO_SEARCH_SRCS main.cpp) add_executable(baloosearch ${BALOO_SEARCH_SRCS}) +ecm_mark_nongui_executable(baloosearch) target_compile_definitions(baloosearch PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_link_libraries(baloosearch KF5::I18n KF5::CoreAddons KF5::Baloo ) install(TARGETS baloosearch DESTINATION ${BIN_INSTALL_DIR}) diff --git a/src/tools/balooshow/CMakeLists.txt b/src/tools/balooshow/CMakeLists.txt index f01f093b..1c3ff00f 100644 --- a/src/tools/balooshow/CMakeLists.txt +++ b/src/tools/balooshow/CMakeLists.txt @@ -1,16 +1,17 @@ add_definitions(-DTRANSLATION_DOMAIN=\"balooshow5\") set(SRCS main.cpp) add_executable(balooshow ${SRCS}) +ecm_mark_nongui_executable(balooshow) target_compile_definitions(balooshow PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}") target_link_libraries(balooshow KF5::Baloo KF5::BalooEngine KF5::FileMetaData KF5::CoreAddons KF5::I18n ) install(TARGETS balooshow DESTINATION ${BIN_INSTALL_DIR})