2024-02-02 17:02:15 +08:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(ukui-search VERSION 1.0 LANGUAGES C CXX)
|
|
|
|
|
2023-08-15 17:34:41 +08:00
|
|
|
set(VERSION_MAJOR 2)
|
|
|
|
set(VERSION_MINOR 3)
|
|
|
|
set(VERSION_MICRO 0)
|
|
|
|
set(LIBUKUI_SEARCH_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO})
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
2024-04-15 09:52:06 +08:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core DBus Widgets Xml Concurrent Sql LinguistTools RemoteObjects REQUIRED)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core DBus Widgets Xml Concurrent Sql LinguistTools RemoteObjects REQUIRED)
|
2023-08-15 17:34:41 +08:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
find_package(KF5WindowSystem)
|
|
|
|
find_package(qt5xdg)
|
2023-11-08 10:08:04 +08:00
|
|
|
find_package(ukui-file-metadata)
|
2024-02-02 17:02:15 +08:00
|
|
|
find_package(xapian)
|
2023-08-15 17:34:41 +08:00
|
|
|
|
|
|
|
set(LIBUKUI_SEARCH_EXTERNAL_LIBS "")
|
|
|
|
set(LIBUKUI_SEARCH_PC_PKGS
|
|
|
|
gio-2.0
|
|
|
|
glib-2.0
|
|
|
|
gio-unix-2.0
|
|
|
|
gsettings-qt
|
|
|
|
poppler-qt5
|
|
|
|
kysdk-qtwidgets
|
|
|
|
uchardet
|
2023-11-01 10:56:16 +08:00
|
|
|
kysdk-systime
|
2024-04-17 17:43:50 +08:00
|
|
|
kysdk-datacollect
|
2024-04-17 15:34:14 +08:00
|
|
|
kylin-ai-base
|
|
|
|
)
|
2023-08-15 17:34:41 +08:00
|
|
|
|
|
|
|
foreach(PC_LIB IN ITEMS ${LIBUKUI_SEARCH_PC_PKGS})
|
|
|
|
pkg_check_modules(${PC_LIB} REQUIRED IMPORTED_TARGET ${PC_LIB})
|
|
|
|
if(${${PC_LIB}_FOUND})
|
|
|
|
include_directories(${${PC_LIB}_INCLUDE_DIRS})
|
|
|
|
link_directories(${${PC_LIB}_LIBRARY_DIRS})
|
|
|
|
list(APPEND LIBUKUI_SEARCH_EXTERNAL_LIBS PkgConfig::${PC_LIB})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(LIBUKUI_SEARCH_SRC
|
|
|
|
appdata/app-info-dbus-argument.h
|
|
|
|
appdata/app-info-table.cpp appdata/app-info-table.h
|
|
|
|
appdata/app-info-table-private.h
|
|
|
|
appdata/application-info.cpp appdata/application-info.h
|
|
|
|
appdata/application-property.h
|
|
|
|
appdata/application-property-helper.cpp appdata/application-property-helper.h
|
|
|
|
appsearch/app-search-plugin.cpp appsearch/app-search-plugin.h
|
|
|
|
common.h
|
|
|
|
dirwatcher/dir-watcher.cpp dirwatcher/dir-watcher.h
|
|
|
|
file-utils.cpp file-utils.h
|
|
|
|
filesystemwatcher/file-system-watcher.cpp filesystemwatcher/file-system-watcher.h
|
|
|
|
filesystemwatcher/file-system-watcher-private.h
|
|
|
|
global-settings.cpp global-settings.h
|
|
|
|
global-settings-private.h
|
|
|
|
gobject-template.cpp gobject-template.h
|
|
|
|
index/basic-indexer.cpp index/basic-indexer.h
|
|
|
|
index/batch-indexer.cpp index/batch-indexer.h
|
2024-04-17 17:43:50 +08:00
|
|
|
index/ai-indexer.cpp index/ai-indexer.h
|
2023-08-15 17:34:41 +08:00
|
|
|
index/compatible-define.h
|
|
|
|
index/database.cpp index/database.h
|
|
|
|
index/document.cpp index/document.h
|
|
|
|
index/file-content-indexer.cpp index/file-content-indexer.h
|
|
|
|
index/file-indexer-config.cpp index/file-indexer-config.h
|
|
|
|
index/file-reader.cpp index/file-reader.h
|
|
|
|
index/file-search-plugin.cpp index/file-search-plugin.h
|
|
|
|
index/file-watcher.cpp index/file-watcher.h
|
|
|
|
index/index-scheduler.cpp index/index-scheduler.h
|
|
|
|
index/index-status-recorder.cpp index/index-status-recorder.h
|
|
|
|
index/index-updater.cpp index/index-updater.h
|
|
|
|
index/pending-file.cpp index/pending-file.h
|
|
|
|
index/pending-file-queue.cpp index/pending-file-queue.h
|
|
|
|
index/search-manager.cpp index/search-manager.h
|
|
|
|
index/ukui-search-qdbus.cpp index/ukui-search-qdbus.h
|
|
|
|
index/writable-database.cpp index/writable-database.h
|
2024-04-15 09:52:06 +08:00
|
|
|
index/file-extraction-result.cpp
|
|
|
|
index/file-extraction-result.h
|
|
|
|
index/index-monitor.cpp
|
2023-08-15 17:34:41 +08:00
|
|
|
libsearch_global.h
|
|
|
|
log-utils.cpp log-utils.h
|
|
|
|
notesearch/note-search-plugin.cpp notesearch/note-search-plugin.h
|
|
|
|
parser/binary-parser.cpp parser/binary-parser.h
|
|
|
|
parser/common.h
|
|
|
|
plugininterface/action-label.cpp plugininterface/action-label.h
|
|
|
|
plugininterface/action-transmiter.cpp plugininterface/action-transmiter.h
|
|
|
|
plugininterface/data-queue.h
|
|
|
|
plugininterface/plugin-iface.h
|
|
|
|
plugininterface/search-plugin-iface.cpp plugininterface/search-plugin-iface.h
|
|
|
|
plugininterface/search-task-plugin-iface.h
|
|
|
|
plugininterface/separation-line.cpp plugininterface/separation-line.h
|
|
|
|
pluginmanage/plugin-info.h
|
|
|
|
pluginmanage/plugin-manager.cpp pluginmanage/plugin-manager.h
|
|
|
|
pluginmanage/search-plugin-manager.cpp pluginmanage/search-plugin-manager.h
|
|
|
|
pluginmanage/search-task-plugin-manager.cpp pluginmanage/search-task-plugin-manager.h
|
|
|
|
searchinterface/result-item.cpp searchinterface/result-item.h
|
|
|
|
searchinterface/search-controller.cpp searchinterface/search-controller.h
|
|
|
|
searchinterface/search-result-property.h
|
|
|
|
searchinterface/search-result-property-info.cpp searchinterface/search-result-property-info.h
|
|
|
|
searchinterface/searchtasks/app-search-task.cpp searchinterface/searchtasks/app-search-task.h
|
|
|
|
searchinterface/searchtasks/file-content-search-task.cpp searchinterface/searchtasks/file-content-search-task.h
|
|
|
|
searchinterface/searchtasks/file-search-task.cpp searchinterface/searchtasks/file-search-task.h
|
|
|
|
searchinterface/ukui-search-task.cpp searchinterface/ukui-search-task.h
|
|
|
|
settingsearch/settings-search-plugin.cpp settingsearch/settings-search-plugin.h
|
|
|
|
websearch/web-search-plugin.cpp websearch/web-search-plugin.h
|
2024-04-17 15:34:14 +08:00
|
|
|
aisearch/ai-search-plugin.cpp aisearch/ai-search-plugin.h
|
|
|
|
thumbnail-creator.cpp thumbnail-creator.h
|
2023-09-01 17:30:21 +08:00
|
|
|
icon-loader.cpp icon-loader.h
|
2023-11-01 10:56:16 +08:00
|
|
|
data-collecter.cpp
|
|
|
|
data-collecter.h
|
2024-05-27 15:37:19 +08:00
|
|
|
remote-file-event-helper.cpp
|
2023-11-01 10:56:16 +08:00
|
|
|
)
|
2024-04-15 09:52:06 +08:00
|
|
|
qt5_generate_repc(LIBUKUI_SEARCH_SRC index/monitor.rep REPLICA)
|
2023-08-15 17:34:41 +08:00
|
|
|
set(QRC_FILES resource1.qrc)
|
|
|
|
file(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../translations/libukui-search/*.ts)
|
|
|
|
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/libsearch/.qm)
|
|
|
|
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES})
|
|
|
|
|
2024-05-27 15:37:19 +08:00
|
|
|
qt5_generate_repc(LIBUKUI_SEARCH_SRC fileeventhandler.rep REPLICA)
|
|
|
|
|
2024-02-02 17:02:15 +08:00
|
|
|
add_library(${PROJECT_NAME} SHARED
|
2023-08-15 17:34:41 +08:00
|
|
|
${LIBUKUI_SEARCH_SRC}
|
|
|
|
${QRC_FILES}
|
|
|
|
${QM_FILES}
|
|
|
|
)
|
|
|
|
set(HEADERS
|
|
|
|
libsearch_global.h
|
|
|
|
plugininterface/action-label.h
|
|
|
|
plugininterface/action-transmiter.h
|
|
|
|
plugininterface/data-queue.h
|
|
|
|
plugininterface/plugin-iface.h
|
|
|
|
plugininterface/search-plugin-iface.h
|
|
|
|
plugininterface/search-task-plugin-iface.h
|
|
|
|
plugininterface/separation-line.h
|
|
|
|
appdata/application-info.h
|
|
|
|
appdata/application-property.h
|
|
|
|
appdata/application-property-helper.h
|
|
|
|
searchinterface/ukui-search-task.h
|
|
|
|
searchinterface/result-item.h
|
|
|
|
searchinterface/search-result-property.h
|
|
|
|
filesystemwatcher/file-system-watcher.h
|
|
|
|
development-files/header-files/UkuiSearchTask
|
|
|
|
development-files/header-files/UkuiSearchPluginIface
|
|
|
|
development-files/header-files/FileSystemWatcher
|
2024-04-15 09:52:06 +08:00
|
|
|
index/index-monitor.h
|
2023-08-15 17:34:41 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
../libchinese-segmentation
|
|
|
|
appdata
|
|
|
|
appsearch
|
|
|
|
dirwatcher
|
|
|
|
filesystemwatcher
|
|
|
|
index
|
|
|
|
notesearch
|
|
|
|
parser
|
|
|
|
plugininterface
|
|
|
|
pluginmanage
|
|
|
|
searchinterface
|
|
|
|
searchinterface/searchtasks
|
|
|
|
settingsearch
|
|
|
|
websearch
|
2024-04-17 15:34:14 +08:00
|
|
|
aisearch
|
2023-08-15 17:34:41 +08:00
|
|
|
)
|
|
|
|
|
2024-02-02 17:02:15 +08:00
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
2023-08-15 17:34:41 +08:00
|
|
|
PLUGIN_INSTALL_DIRS="/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/ukui-search-plugins"
|
|
|
|
QT_NO_KEYWORDS
|
|
|
|
)
|
|
|
|
|
2024-02-02 17:02:15 +08:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
2023-08-15 17:34:41 +08:00
|
|
|
KF5::WindowSystem
|
|
|
|
Qt5Xdg
|
|
|
|
Qt${QT_VERSION_MAJOR}::Concurrent
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::DBus
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
|
|
Qt${QT_VERSION_MAJOR}::Sql
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
|
|
Qt${QT_VERSION_MAJOR}::Xml
|
2024-04-15 09:52:06 +08:00
|
|
|
Qt${QT_VERSION_MAJOR}::RemoteObjects
|
2023-08-15 17:34:41 +08:00
|
|
|
chinese-segmentation
|
|
|
|
quazip5
|
|
|
|
uchardet
|
|
|
|
xapian
|
2023-11-08 10:08:04 +08:00
|
|
|
ukui-file-metadata
|
2023-08-15 17:34:41 +08:00
|
|
|
${LIBUKUI_SEARCH_EXTERNAL_LIBS}
|
|
|
|
)
|
|
|
|
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
set(CMAKE_CONFIG_INSTALL_DIR "/usr/share/cmake/ukui-search")
|
|
|
|
set(HEADERS_INSTALL_DIR /usr/include/ukui-search)
|
|
|
|
set(PC_INSTALL_DIR "/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
|
|
|
|
|
2024-02-02 17:02:15 +08:00
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:${HEADERS_INSTALL_DIR}>)
|
2023-08-15 17:34:41 +08:00
|
|
|
|
|
|
|
configure_package_config_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ukui-search-config.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/ukui-search-config.cmake"
|
|
|
|
INSTALL_DESTINATION ${CMAKE_CONFIG_INSTALL_DIR})
|
|
|
|
write_basic_package_version_file(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ukui-search-config-version.cmake
|
|
|
|
VERSION ${LIBUKUI_SEARCH_VERSION}
|
|
|
|
COMPATIBILITY SameMajorVersion
|
|
|
|
)
|
|
|
|
configure_package_config_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ukui-search.pc.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/ukui-search.pc"
|
|
|
|
INSTALL_DESTINATION ${PC_INSTALL_DIR})
|
|
|
|
|
2024-02-02 17:02:15 +08:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
2023-08-15 17:34:41 +08:00
|
|
|
VERSION ${LIBUKUI_SEARCH_VERSION}
|
|
|
|
SOVERSION ${VERSION_MAJOR}
|
|
|
|
OUTPUT_NAME ukui-search
|
|
|
|
)
|
2024-02-02 17:02:15 +08:00
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
EXPORT ${PROJECT_NAME}
|
2023-08-15 17:34:41 +08:00
|
|
|
PUBLIC_HEADER DESTINATION ${HEADERS_INSTALL_DIR}
|
|
|
|
LIBRARY DESTINATION /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
|
|
|
)
|
2024-02-02 17:02:15 +08:00
|
|
|
install(EXPORT ${PROJECT_NAME}
|
|
|
|
FILE ${PROJECT_NAME}-targets.cmake
|
2023-08-15 17:34:41 +08:00
|
|
|
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR})
|
|
|
|
install(FILES ${QM_FILES} DESTINATION /usr/share/ukui-search/translations/libukui-search)
|
|
|
|
|
|
|
|
install(FILES ${HEADERS} DESTINATION ${HEADERS_INSTALL_DIR})
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/ukui-search.pc DESTINATION ${PC_INSTALL_DIR})
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ukui-search-config.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ukui-search-config-version.cmake
|
2023-11-01 10:56:16 +08:00
|
|
|
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR})
|
2024-04-15 09:52:06 +08:00
|
|
|
if(BUILD_TEST)
|
|
|
|
add_subdirectory(test)
|
2024-05-27 15:37:19 +08:00
|
|
|
endif ()
|