1 Star 0 Fork 6

sn123../kylin-printer

forked from openKylin/kylin-printer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 4.77 KB
一键复制 编辑 原始数据 按行查看 历史
jiangdingyuan 提交于 2022-10-13 11:16 . Import Upstream version 1.3.0
cmake_minimum_required(VERSION 3.5)
#Set Project Name
project(kylin-printer LANGUAGES CXX C)
project(${PROJECT_NAME} VERSION 1.3.0)
set(PROJECT_VERSION_DETAIL "1.3.0-ok10")
include(${PROJECT_SOURCE_DIR}/cmake/common.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/printer.cmake)
option(TEST_DEBUG "option for debug" OFF)
if (TEST_DEBUG)
add_definitions(-DTEST_DEBUG)
add_definitions(-DPROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\")
add_definitions(-DPROJECT_BINARY_DIR=\"${PROJECT_BINARY_DIR}\")
endif(TEST_DEBUG)
add_definitions(-DPROJECT_NAME=\"${PROJECT_NAME}\")
add_subdirectory(backend)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
find_package(QT NAMES Qt6 Qt5)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools Network DBus REQUIRED)
execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/sh/update_translations.sh
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
execute_process(COMMAND bash ${PROJECT_SOURCE_DIR}/sh/apply_translations.sh
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
#add include
include_directories(${PROJECT_SOURCE_DIR}/printer_manager/
${PROJECT_SOURCE_DIR}/device_manager/
${PROJECT_SOURCE_DIR}/ui/
${PROJECT_SOURCE_DIR}/ui/custom_ui/
${PROJECT_SOURCE_DIR}/ui/main_win_ui/
${PROJECT_SOURCE_DIR}/ui/new_pop_window/
${PROJECT_SOURCE_DIR}/util/
${PROJECT_SOURCE_DIR}/dictionary/
${PROJECT_SOURCE_DIR}/common/
${PROJECT_SOURCE_DIR}/avahi_qt/
${PROJECT_SOURCE_DIR}/qt_zeroconf/
${PROJECT_SOURCE_DIR}/ui/new_property_window/
${PROJECT_SOURCE_DIR}/ui/new_property_window/SecondComponent/
)
add_definitions("-Wall")
configure_file(config.h.in
config.h
@ONLY
)
file(GLOB common_SRC
"common/*"
)
file(GLOB avahi_qt_SRC
"avahi_qt/*.cpp"
"avahi_qt/*.h"
"qt_zeroconf/*.cpp"
"qt_zeroconf/*.h"
)
file(GLOB printer_manager_SRC
"printer_manager/*.cpp"
"printer_manager/*.c"
"printer_manager/*.h"
)
file(GLOB device_manager_SRC
"device_manager/device_information.*"
"device_manager/device_monitor.*"
"device_manager/network_device_detector.*"
"device_manager/network_device_monitor.*"
"device_manager/udev_devices.*"
)
file(GLOB dictionary_SRC
"dictionary/*.cpp"
"dictionary/*.h"
)
file(GLOB ui_SRC
"ui/*.cpp"
"ui/*.h"
"ui/main_win_ui/*.cpp"
"ui/main_win_ui/*.h"
"ui/new_pop_window/*.cpp"
"ui/new_pop_window/*.h"
"ui/custom_ui/*"
"ui/new_property_window/*.h"
"ui/new_property_window/*.cpp"
"ui/new_property_window/SecondComponent/*.h"
"ui/new_property_window/SecondComponent/*.cpp"
)
file(GLOB util_SRC
"util/*.cpp"
"util/*.h"
)
SET(ui_RESOURCE ${PROJECT_SOURCE_DIR}/ui/picture.qrc)
set(TS_FILES ${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}_zh_CN.ts
${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}_en.ts
${PROJECT_SOURCE_DIR}/translations/${PROJECT_NAME}_dict_zh_CN.ts)
QT5_CREATE_TRANSLATION(QM_FILES
${ui_SRC}
${TS_FILES})
add_executable(${PROJECT_NAME}
main.cpp
${common_SRC}
${printer_manager_SRC}
${device_manager_SRC}
${ui_SRC}
${util_SRC}
${ui_RESOURCE}
${avahi_qt_SRC}
${dictionary_SRC}
${QM_FILES}
)
target_link_kysdk_libraries(${PROJECT_NAME})
target_link_glib_libraries(${PROJECT_NAME})
target_link_snmp_libraries(${PROJECT_NAME})
target_link_qgsettings_libraries(${PROJECT_NAME})
target_link_cups_libraries(${PROJECT_NAME})
target_link_cupsfilters_libraries(${PROJECT_NAME})
target_link_avahi_libraries(${PROJECT_NAME})
target_link_usb_libraries(${PROJECT_NAME})
target_link_udev_libraries(${PROJECT_NAME})
target_link_KWindowSystem_libraries(${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::DBus)
#dependencies
target_link_libraries(${PROJECT_NAME} "-lpthread -lz")
########### install ###############
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
install(FILES ${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.desktop DESTINATION /usr/share/applications/)
install(FILES ${PROJECT_SOURCE_DIR}/data/org.kylin.printer.gschema.xml DESTINATION /usr/share/glib-2.0/schemas/)
file(GLOB TRANS "${PROJECT_SOURCE_DIR}/translations/*.qm")
install(FILES ${TRANS} DESTINATION /usr/share/${PROJECT_NAME}/translations/)
# v10 SP1 only
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data/guide/${PROJECT_NAME} DESTINATION /usr/share/kylin-user-guide/data/guide/)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xtfvje/kylin-printer.git
git@gitee.com:xtfvje/kylin-printer.git
xtfvje
kylin-printer
kylin-printer
openkylin/yangtze

搜索帮助