66 lines
2.4 KiB
CMake
66 lines
2.4 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
project(ukui-search-app-data-service VERSION 1.0.0 LANGUAGES CXX)
|
|
|
|
set(VERSION_MAJOR 1)
|
|
set(VERSION_MINOR 0)
|
|
set(VERSION_MICRO 0)
|
|
set(UKUI_SEARCH_APP_DATA_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)
|
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core DBus Gui Widgets Sql Network REQUIRED)
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core DBus Gui Widgets Sql Network REQUIRED)
|
|
find_package(KF5WindowSystem)
|
|
find_package(qt5xdg)
|
|
|
|
set(UKUI_SEARCH_APP_DATA_SERVICE_SRC
|
|
app-db-manager.cpp app-db-manager.h
|
|
main.cpp
|
|
pending-app-info.h
|
|
pending-app-info-queue.cpp pending-app-info-queue.h
|
|
signal-transformer.cpp signal-transformer.h
|
|
ukui-search-app-data-service.cpp ukui-search-app-data-service.h)
|
|
|
|
if(COMMAND qt_add_dbus_adaptor)
|
|
qt_add_dbus_adaptor(UKUI_SEARCH_APP_DATA_SERVICE_SRC dbus/org.ukui.AppDatabase.xml app-db-manager.h UkuiSearch::AppDBManager)
|
|
else()
|
|
qt5_add_dbus_adaptor(UKUI_SEARCH_APP_DATA_SERVICE_SRC dbus/org.ukui.AppDatabase.xml app-db-manager.h UkuiSearch::AppDBManager)
|
|
endif()
|
|
|
|
add_executable(ukui-search-app-data-service
|
|
${UKUI_SEARCH_APP_DATA_SERVICE_SRC}
|
|
)
|
|
target_include_directories(ukui-search-app-data-service PRIVATE
|
|
../3rd-parties/qtsingleapplication/src
|
|
../libchinese-segmentation
|
|
../libsearch
|
|
../libsearch/appdata
|
|
../libsearch/filesystemwatcher
|
|
)
|
|
|
|
target_compile_definitions(ukui-search-app-data-service PRIVATE
|
|
QT_DEPRECATED_WARNINGS
|
|
VERSION="${UKUI_SEARCH_APP_DATA_SERVICE_VERSION}"
|
|
)
|
|
|
|
target_link_libraries(ukui-search-app-data-service PRIVATE
|
|
KF5::WindowSystem
|
|
Qt5Xdg
|
|
Qt${QT_VERSION_MAJOR}::Core
|
|
Qt${QT_VERSION_MAJOR}::DBus
|
|
Qt${QT_VERSION_MAJOR}::Gui
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
|
Qt${QT_VERSION_MAJOR}::Network
|
|
Qt${QT_VERSION_MAJOR}::Sql
|
|
chinese-segmentation
|
|
ukui-search
|
|
qtsingleapplication
|
|
)
|
|
|
|
install(TARGETS ukui-search-app-data-service DESTINATION /usr/bin)
|
|
install(FILES ../data/ukui-search-app-data-service.desktop DESTINATION /etc/xdg/autostart)
|
|
install(FILES conf/com.ukui.search.appdb.service DESTINATION /usr/share/dbus-1/services/)
|
|
install(FILES conf/application-dirs.conf DESTINATION /etc/ukui/ukui-search/) |