-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
85 lines (70 loc) · 2.62 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.5)
project(lubuntu-update VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Widgets DBus LinguistTools)
set(TS_FILES
src/translations/lubuntu-update_en_US.ts
src/translations/lubuntu-update_es_ES.ts
src/translations/lubuntu-update_zh_CN.ts
)
set(PROJECT_SOURCES
src/main.cpp
src/mainwindow.cpp
src/mainwindow.h
src/mainwindow.ui
src/orchestrator.h
src/orchestrator.cpp
src/aptmanager.h
src/aptmanager.cpp
src/conffilewidget.h
src/conffilewidget.cpp
src/conffilewidget.ui
src/diffdisplaydialog.h
src/diffdisplaydialog.cpp
src/diffdisplaydialog.ui
src/conffilehandlerdialog.h
src/conffilehandlerdialog.cpp
src/conffilehandlerdialog.ui
src/releaseupgradewindow.h
src/releaseupgradewindow.cpp
src/releaseupgradewindow.ui
src/upgradedelaywindow.h
src/upgradedelaywindow.cpp
src/upgradedelaywindow.ui
src/windowshowwatcher.h
src/windowshowwatcher.cpp
${TS_FILES}
)
set(TRANSLATION_RESOURCES "src/translations.qrc")
configure_file(${TRANSLATION_RESOURCES} translations.qrc COPYONLY)
qt6_add_translation(QM_FILES ${TS_FILES})
qt6_add_resources(QM_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
add_custom_target(translations ALL DEPENDS ${QM_FILES})
add_executable(lubuntu-update
${PROJECT_SOURCES}
${QM_RESOURCES}
src/resources.qrc
)
add_dependencies(lubuntu-update translations)
target_link_libraries(lubuntu-update PRIVATE
Qt6::Widgets
Qt6::DBus)
install(TARGETS lubuntu-update
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Yes, we are hardcoding a path here. Yes, it's ugly. However, the program
# will attempt to run this script as root, and I do NOT want to make it try to
# "find" the script and execute the first thing it finds that has the right
# name, that sounds like a security breach waiting to happen. It will only
# execute lubuntu-update-backend from /usr/libexec, and if something malicious
# has gotten into /usr/libexec you're compromised anyway, so not much to worry
# about. Therefore we always, *always* install this script into /usr/libexec/,
# no matter where the rest of the program goes.
install(FILES src/lubuntu-update-backend DESTINATION /usr/libexec/)
install(FILES lubuntu-update.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/)