2023-08-15 17:34:41 +08:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(ukui-search-service VERSION 1.0.0 LANGUAGES C CXX)
|
|
|
|
|
|
|
|
set(VERSION_MAJOR 1)
|
|
|
|
set(VERSION_MINOR 0)
|
|
|
|
set(VERSION_MICRO 0)
|
|
|
|
set(UKUI_SEARCH_SERVICE_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)
|
|
|
|
|
2023-10-07 15:44:59 +08:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core DBus Gui Quick Widgets RemoteObjects REQUIRED)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core DBus Gui Quick Widgets RemoteObjects REQUIRED)
|
2023-08-15 17:34:41 +08:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
set(UKUI_SEARCH_SERVICE_EXTERNAL_LIBS "")
|
|
|
|
set(UKUI_SEARCH_SERVICE_PC_PKGS gsettings-qt)
|
|
|
|
|
|
|
|
foreach(PC_LIB IN ITEMS ${UKUI_SEARCH_SERVICE_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 UKUI_SEARCH_SERVICE_EXTERNAL_LIBS PkgConfig::${PC_LIB})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set(QRC_FILES qml/qml.qrc)
|
2023-10-07 15:44:59 +08:00
|
|
|
set(UKUI_SEARCH_SERVICE_SRC
|
2023-08-15 17:34:41 +08:00
|
|
|
main.cpp
|
2023-10-07 15:44:59 +08:00
|
|
|
ukui-search-service.cpp
|
|
|
|
ukui-search-service.h
|
|
|
|
monitor.cpp
|
|
|
|
monitor.h
|
|
|
|
)
|
2024-04-15 09:52:06 +08:00
|
|
|
qt5_generate_repc(UKUI_SEARCH_SERVICE_SRC ../libsearch/index/monitor.rep SOURCE)
|
2023-10-07 15:44:59 +08:00
|
|
|
add_executable(ukui-search-service
|
|
|
|
${UKUI_SEARCH_SERVICE_SRC}
|
2023-08-15 17:34:41 +08:00
|
|
|
${QRC_FILES}
|
|
|
|
)
|
|
|
|
target_include_directories(ukui-search-service PRIVATE
|
|
|
|
../3rd-parties/qtsingleapplication/src
|
|
|
|
../libsearch
|
|
|
|
../libsearch/dirwatcher
|
|
|
|
../libsearch/filesystemwatcher
|
|
|
|
../libsearch/index
|
|
|
|
../libsearch/parser
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(ukui-search-service PRIVATE
|
|
|
|
QT_DEPRECATED_WARNINGS
|
2023-10-09 10:27:29 +08:00
|
|
|
VERSION="${UKUI_SEARCH_SERVICE_VERSION}"
|
2023-08-15 17:34:41 +08:00
|
|
|
QT_NO_KEYWORDS
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(ukui-search-service PRIVATE
|
|
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
|
|
Qt${QT_VERSION_MAJOR}::DBus
|
|
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
|
|
Qt${QT_VERSION_MAJOR}::Quick
|
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
2023-10-07 15:44:59 +08:00
|
|
|
Qt${QT_VERSION_MAJOR}::RemoteObjects
|
2024-02-02 17:02:15 +08:00
|
|
|
ukui-search
|
2023-08-15 17:34:41 +08:00
|
|
|
qtsingleapplication
|
|
|
|
${UKUI_SEARCH_SERVICE_EXTERNAL_LIBS}
|
|
|
|
)
|
|
|
|
install(FILES ../data/org.ukui.search.data.gschema.xml DESTINATION /usr/share/glib-2.0/schemas/)
|
|
|
|
install(FILES ../data/ukui-search-service.desktop DESTINATION /etc/xdg/autostart)
|
|
|
|
install(TARGETS ukui-search-service DESTINATION /usr/bin)
|