-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (42 loc) · 1.48 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 3.5)
#Set Project Name
project(kylin-printer LANGUAGES CXX)
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)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets X11Extras Network DBus REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets X11Extras Network DBus REQUIRED)
find_package(KF5WindowSystem REQUIRED)
#add include
include_directories(${PROJECT_SOURCE_DIR}/printer_manager/)
include_directories(${PROJECT_SOURCE_DIR}/ui/)
file(GLOB printer_manager_SRC
"printer_manager/*.cpp"
"printer_manager/*.h"
)
file(GLOB ui_SRC
"ui/*.cpp"
"ui/*.h"
)
SET(ui_RESOURCE ${PROJECT_SOURCE_DIR}/ui/picture.qrc)
add_executable(kylin-printer
main.cpp
${printer_manager_SRC}
${ui_SRC}
${ui_RESOURCE}
)
target_link_libraries(kylin-printer Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::X11Extras Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::DBus)
#dependencies
target_link_libraries(kylin-printer "-lpthread -lz")
#cups
target_link_libraries(kylin-printer "-lcups")
#deb install
target_link_libraries(kylin-printer "-lQApt")
target_link_libraries(kylin-printer KF5::WindowSystem)
target_link_libraries(kylin-printer -lX11)
########### install ###############
install(TARGETS kylin-printer DESTINATION /usr/bin/)
install(FILES ${PROJECT_SOURCE_DIR}/kylin-printer.desktop DESTINATION /etc/xdg/autostart/)