-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
120 lines (101 loc) · 2.63 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
cmake_minimum_required(VERSION 3.16)
project(tunnelmanager LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
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 COMPONENTS Widgets REQUIRED)
find_package(Qt6 COMPONENTS LinguistTools QUIET)
if(WIN32)
list(APPEND TUNNELMANAGER_DEFINES
-DUNICODE
-D_UNICODE
-DWIN32
)
list(APPEND TUNNELMANAGER_RESOURCES
app.rc
)
endif()
set(TUNNELMANAGER_SOURCES
main.cpp
mainwindow.cpp
newentry.cpp
AppEnv.cpp
TranslationClass.cpp
)
set(TUNNELMANAGER_HEADERS
config.h
mainwindow.h
newentry.h
AppEnv.h
TranslationClass.h
)
set(TUNNELMANAGER_FORMS
mainwindow.ui
newentry.ui
)
list(APPEND TUNNELMANAGER_RESOURCES
res.qrc
)
if(Qt6LinguistTools_FOUND)
qt6_add_translation(TUNNELMANAGER_TRANSLATIONS
lang/tm_de.ts
)
add_custom_target(translations DEPENDS ${TUNNELMANAGER_TRANSLATIONS})
else()
set(TUNNELMANAGER_TRANSLATIONS
lang/tm_de.qm
)
endif()
option(QCONF_BUILD "System installation intended Qconf build" OFF)
if(QCONF_BUILD)
list(APPEND TUNNELMANAGER_DEFINES
-DTM_QCONF
)
else()
list(APPEND TUNNELMANAGER_RESOURCES
lang/tm_tr.qrc
lang/tr_qt6.qrc
)
endif()
if(TUNNELMANAGER_APPVER)
list(APPEND TUNNELMANAGER_DEFINES
"-DTM_APPVER=\"${TUNNELMANAGER_APPVER}\""
)
endif()
if(TUNNELMANAGER_BUILDTYPE)
list(APPEND TUNNELMANAGER_DEFINES
"-DTM_BUILDTYPE=\"${TUNNELMANAGER_BUILDTYPE}\""
)
endif()
if(TUNNELMANAGER_INLANG)
list(APPEND TUNNELMANAGER_DEFINES
"-DTM_INLANG=\"${TUNNELMANAGER_INLANG}\""
)
endif()
if(TUNNELMANAGER_LANG)
list(APPEND TUNNELMANAGER_DEFINES
"-DTM_LANG=\"${TUNNELMANAGER_LANG}\""
)
endif()
add_executable(tunnelmanager
WIN32 MACOSX_BUNDLE
${TUNNELMANAGER_HEADERS}
${TUNNELMANAGER_SOURCES}
${TUNNELMANAGER_FORMS}
${TUNNELMANAGER_RESOURCES}
)
if(Qt6LinguistTools_FOUND AND QCONF_BUILD)
add_dependencies(tunnelmanager translations)
endif()
target_precompile_headers(tunnelmanager PRIVATE config.h)
target_compile_definitions(tunnelmanager PRIVATE ${TUNNELMANAGER_DEFINES})
target_link_libraries(tunnelmanager PRIVATE Qt6::Widgets ${TUNNELMANAGER_LIBS})
install(TARGETS tunnelmanager DESTINATION bin)
install(FILES de.shyim.tunnelmanager.desktop DESTINATION share/applications)
install(FILES server.png DESTINATION share/pixmaps RENAME de.shyim.tunnelmanager.png)
if(QCONF_BUILD)
install(FILES ${TUNNELMANAGER_TRANSLATIONS} DESTINATION share/tunnelmanager/translations)
endif()