-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
81 lines (71 loc) · 2.09 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
cmake_minimum_required(VERSION 3.4)
project(usbguard-applet-qt)
find_package(Qt5 5.10 CONFIG REQUIRED COMPONENTS Core Gui Widgets DBus LinguistTools)
find_package(PkgConfig REQUIRED)
pkg_check_modules(USBGUARD REQUIRED IMPORTED_TARGET libusbguard)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DQT_STRICT_ITERATORS)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_DEPRECATED_WARNINGS)
add_definitions(-DQT_DISABLE_DEPRECATED_UP_TO=0x050A00)
add_definitions(-DQT_NO_KEYWORDS)
add_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
file(GLOB ts_files
"translations/*.ts"
)
qt5_add_translation(qm_files ${ts_files})
add_custom_command(
OUTPUT translations.qrc
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/translations/generate_translations_qrc.sh" translations.qrc ${qm_files}
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/translations/generate_translations_qrc.sh" ${qm_files}
)
set(applet_SOURCES
DBusBridge.cpp
DeviceDialog.cpp
DeviceModel.cpp
LibUsbguard.cpp
Log.cpp
MainWindow.cpp
TargetDelegate.cpp
main.cpp
)
set(applet_FORMS
DeviceDialog.ui
MainWindow.ui
)
set(applet_RESOURCES
resources/icon.qrc
"${CMAKE_BINARY_DIR}/translations.qrc"
)
set_source_files_properties(org.usbguard1.xml PROPERTIES INCLUDE DBusTypes.h)
qt5_add_dbus_interface(applet_SOURCES
org.usbguard1.xml
OrgUsbguardInterface
)
add_executable(usbguard-applet-qt
${applet_SOURCES}
${applet_FORMS}
${applet_RESOURCES}
)
target_link_libraries(usbguard-applet-qt
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::DBus
PkgConfig::USBGUARD
)
install(TARGETS usbguard-applet-qt
DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES usbguard-applet-qt.desktop
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
install(FILES resources/usbguard-icon.svg
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps")