You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
cmake_minimum_required(VERSION 3.7)
|
|
|
|
set(LIB_NAME "dp4-login-plugin")
|
|
|
|
project(${LIB_NAME})
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
# 启用 qt moc 的支持
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
find_package(Qt5 COMPONENTS Core Widgets DBus Network LinguistTools REQUIRED)
|
|
find_package(PkgConfig REQUIRED)
|
|
find_package(DdeSessionShell REQUIRED)
|
|
|
|
pkg_check_modules(SSL REQUIRED IMPORTED_TARGET libcrypto libssl openssl)
|
|
|
|
file(GLOB TS_FILES "translations/*.ts")
|
|
qt5_add_translation(QM_FILES ${TS_FILES})
|
|
add_custom_target(${BIN_NAME}_language ALL DEPENDS ${QM_FILES})
|
|
|
|
file(GLOB_RECURSE SRCS "*.h" "*.cpp")
|
|
|
|
add_library(${LIB_NAME} SHARED ${SRCS})
|
|
|
|
target_include_directories(${LIB_NAME} PUBLIC
|
|
${Qt5DBus_INCLUDE_DIRS}
|
|
${DDESESSIONSHELL_INCLUDE_DIR}
|
|
)
|
|
|
|
target_link_libraries(${LIB_NAME} PRIVATE
|
|
${Qt5Widgets_LIBRARIES}
|
|
${Qt5DBus_LIBRARIES}
|
|
)
|
|
|
|
install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib/dde-session-shell/modules)# 安装.qm文件
|
|
install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/${LIB_NAME}/translations/)
|
|
|