ukui-biometric-auth/polkit-agent/CMakeLists.txt

91 lines
2.3 KiB
CMake
Raw Normal View History

2022-06-02 16:34:46 +08:00
cmake_minimum_required(VERSION 2.6)
project(ukui-polkit-agent)
pkg_check_modules(QGS REQUIRED gsettings-qt)
2024-01-19 11:06:44 +08:00
#pkg_search_module(GSETTINGS_QT REQUIRED gsettings-qt)
2024-01-26 16:16:05 +08:00
2024-01-29 16:23:22 +08:00
pkg_check_modules(KDKINFO kysdk-sysinfo)
2024-01-26 16:16:05 +08:00
if (KDKINFO_FOUND)
2024-01-29 16:23:22 +08:00
ADD_DEFINITIONS(-DKDKINFO_FOUND="true")
2024-01-26 16:16:05 +08:00
endif()
2024-01-19 11:06:44 +08:00
#pkg_search_module(KDKINFO REQUIRED kysdk-sysinfo)
2022-06-02 16:34:46 +08:00
find_package(PolkitQt5-1 REQUIRED 0.103.0)
find_package(Qt5 COMPONENTS Core Widgets DBus X11Extras Xml Network Svg)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(LIB_ARCH_PATH /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
configure_file(
${PROJECT_SOURCE_DIR}/data/polkit-ukui-authentication-agent-1.desktop.in
${PROJECT_BINARY_DIR}/data/polkit-ukui-authentication-agent-1.desktop
)
include_directories(
${QGS_INCLUDE_DIRS}
${KDKINFO_INCLUDE_DIRS}
2022-06-02 16:34:46 +08:00
)
link_directories(
${KDKINFO_LIBRARY_DIRS}
)
2022-06-02 16:34:46 +08:00
set(EXTRA_LIBS
${EXTRA_LIBS}
${QGS_LIBRARIES}
${KDKINFO_LIBRARIES}
2022-06-02 16:34:46 +08:00
)
include_directories(
${POLKITQT-1_INCLUDE_DIR}
../common
../bioauth/include
)
qt5_add_resources(polkit_SRCS assets.qrc)
2024-01-19 10:21:18 +08:00
qt5_wrap_ui(polkit_SRCS
src/mainwindow.ui
)
2022-06-02 16:34:46 +08:00
set(polkit_SRCS
${polkit_SRCS}
src/PolkitAgent.cpp
src/mainwindow.cpp
src/PolkitListener.cpp
src/sessionmanager.cpp
src/users.cpp
src/pam-tally.c
src/modeButton.cpp
src/kalabel.cpp
2022-06-02 16:34:46 +08:00
../common/generic.cpp
)
add_executable(polkit-ukui-authentication-agent-1 ${polkit_SRCS})
target_link_libraries(polkit-ukui-authentication-agent-1
Qt5::Core Qt5::Widgets Qt5::DBus ${EXTRA_LIBS}
${POLKITQT-1_LIBRARIES}
2024-01-19 11:06:44 +08:00
${QGS_LIBRARIES}
${KDKINFO_LIBRARIES}
2022-06-02 16:34:46 +08:00
BioAuthWidgets
-lrt
2024-01-19 10:21:18 +08:00
-lukui-log4qt
2022-06-02 16:34:46 +08:00
)
install(TARGETS polkit-ukui-authentication-agent-1
DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/ukui-polkit)
# 翻译文件
file(GLOB ts_files i18n_ts/*.ts)
qt5_add_translation(qm_files ${ts_files})
add_custom_target(polkit_i18n DEPENDS ${qm_files} SOURCES ${ts_files})
add_dependencies(polkit-ukui-authentication-agent-1 polkit_i18n)
install(FILES ${qm_files} DESTINATION ${UKUI_BIOMETRIC_DIR}/i18n_qm/polkit)
install(FILES ${PROJECT_BINARY_DIR}/data/polkit-ukui-authentication-agent-1.desktop
DESTINATION /etc/xdg/autostart)
2024-01-19 10:21:18 +08:00
install(FILES ${PROJECT_BINARY_DIR}/data/polkit-ukui-authentication-agent-1.desktop
DESTINATION /usr/share/applications)