-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
271 lines (246 loc) · 10.5 KB
/
CMakeLists.txt
File metadata and controls
271 lines (246 loc) · 10.5 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
cmake_minimum_required(VERSION 3.20)
project (codepointer)
set(BUILD_VERSION "DEV" CACHE STRING "Build version (DEV, CE, OFFICIAL)")
set_property(CACHE BUILD_VERSION PROPERTY STRINGS DEV CE OFFICIAL)
if(BUILD_VERSION STREQUAL "DEV")
set(APP_SUFFIX "-dev")
set(ICON_NAME "codepointer-dev")
set(BUILD_APP_NAME "codepointer-dev")
elseif(BUILD_VERSION STREQUAL "CE")
set(APP_SUFFIX "-ce")
set(ICON_NAME "codepointer-ce")
set(BUILD_APP_NAME "codepointer-ce")
else()
set(APP_SUFFIX "")
set(ICON_NAME "codepointer")
set(BUILD_APP_NAME "codepointer")
endif()
set(CODEPOINTER_APP_NAME "${BUILD_APP_NAME}")
set(CODEPOINTER_BINARY "codepointer${APP_SUFFIX}")
set(CODEPOINTER_ICON "${ICON_NAME}")
set(CODEPOINTER_MACHINE_NAME "${MACHINE_IDENTIFIER}")
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(cmake/mold-linker.cmake)
set(QMDILIB_BUILD_EXAMPLES OFF)
set(QMDILIB_TESTS OFF)
set(QMDILIB_USE_CMAKEFORMAT OFF)
set(QUTEPART_TESTS OFF)
set(QUTEPART_USE_CMAKEFORMAT OFF)
set(QHEXVIEW_ENABLE_DIALOGS ON)
set(COMMAND_PALLETE_ENABLE_TESTS OFF)
option(CODEPOINTER_WORK_OFFLINE OFF)
if (CODEPOINTER_WORK_OFFLINE)
# For this to work, you need to make these libraries available yourself.
# On Linux/macOS, you can run the script `get-code.sh`. Tested also on
# git/bash form Git on Windows.
add_subdirectory("lib/qmdilib")
add_subdirectory("lib/qutepart-cpp")
add_subdirectory("lib/command-palette-widget")
add_subdirectory("lib/KodoTerm")
add_subdirectory("lib/image-viewer")
add_subdirectory("lib/QJsonModel")
add_subdirectory("lib/QSimpleUpdater")
add_subdirectory("lib/QHexView")
else()
include(cmake/CPM.cmake)
include(cmake/icons-breeze.cmake)
CPMAddPackage("gh:diegoiast/qmdilib#3439468d5cda4d676c714f03919bd9fd7431f5d4")
CPMAddPackage("gh:diegoiast/qutepart-cpp#c30aa3fd16e000b9762e58deae051d8384f8e074")
CPMAddPackage("gh:diegoiast/command-palette-widget#69eb447b61c9d042394a1404c71a0d0b54ac28c0")
CPMAddPackage("gh:diegoiast/KodoTerm#9d016815076a451ad639fa021d46602585e91247")
CPMAddPackage("gh:palacaze/image-viewer#125ea784f93327b471cd9b6b156285e40e70280a")
CPMAddPackage("gh:dridk/QJsonModel#f5fa5988c0ee52fff39a42973c964d5480951f86")
CPMAddPackage("gh:alex-spataru/QSimpleUpdater#8e7017f7fbdc2b4b1a26ed1eef9ebcba6a50639c")
CPMAddPackage("gh:Dax89/QHexView#beadd087413a46e7ed97afbab9dab1323ab1d033")
download_breeze_icons(6.4.0)
endif()
find_package(Qt6 REQUIRED COMPONENTS Widgets Network Svg Xml Concurrent)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(codepointer_sources
${qmdilib_SOURCE_DIR}/demos/common/common.qrc
${qmdilib_SOURCE_DIR}/demos/plugin-demo/iplugin.cpp
${qmdilib_SOURCE_DIR}/demos/plugin-demo/pluginmodel.cpp
${qmdilib_SOURCE_DIR}/demos/plugin-demo/pluginmodel.h
${qmdilib_SOURCE_DIR}/demos/plugin-demo/plugin_list.ui
${qmdilib_SOURCE_DIR}/demos/plugin-demo/pluginmanager.cpp
${qmdilib_SOURCE_DIR}/demos/plugin-demo/pluginmanager.h
${qmdilib_SOURCE_DIR}/demos/plugin-demo/pluginwindow.ui
${qmdilib_SOURCE_DIR}/demos/plugin-demo/plugins/filesystem/filesystembrowser.cpp
${qmdilib_SOURCE_DIR}/demos/plugin-demo/plugins/filesystem/filesystembrowser.h
${qmdilib_SOURCE_DIR}/demos/plugin-demo/plugins/filesystem/filesystemwidget.cpp
${qmdilib_SOURCE_DIR}/demos/plugin-demo/plugins/filesystem/filesystemwidget.h
${qutepart_SOURCE_DIR}/qutepart-syntax-files.qrc
${qutepart_SOURCE_DIR}/qutepart-theme-data.qrc
src/widgets/bannermessage.ui
src/widgets/bannerwidget.cpp
src/widgets/bannerwidget.h
src/widgets/HistoryLineEdit.cpp
src/widgets/HistoryLineEdit.h
src/widgets/BoldItemDelegate.cpp
src/widgets/BoldItemDelegate.hpp
src/widgets/gotolineform.ui
src/widgets/bannermessage.ui
src/widgets/replaceform.ui
src/widgets/searchform.ui
src/widgets/textoperationswidget.cpp
src/widgets/textoperationswidget.h
src/widgets/textoperationsadapter.h
src/widgets/qttextoperationsadapter.cpp
src/widgets/qttextoperationsadapter.h
src/widgets/textpreview.cpp
src/widgets/textpreview.h
src/widgets/xmltreemodel.cpp
src/widgets/xmltreemodel.h
src/widgets/LoadingWidget.cpp
src/widgets/LoadingWidget.hpp
src/widgets/qmdiSplitTab.cpp
src/widgets/qmdiSplitTab.h
src/widgets/qmdieditor.cpp
src/widgets/qmdieditor.h
src/widgets/SplitTabWidget.cpp
src/widgets/SplitTabWidget.h
src/widgets/qmdiSplitTab.cpp
src/widgets/qmdiSplitTab.h
src/widgets/FilesList.cpp
src/widgets/FilesList.hpp
src/widgets/AutoShrinkLabel.cpp
src/widgets/AutoShrinkLabel.hpp
src/plugins/CodeFormat/CodeFormat.cpp
src/plugins/CodeFormat/CodeFormat.hpp
src/plugins/texteditor/texteditor_plg.cpp
src/plugins/texteditor/texteditor_plg.h
src/plugins/texteditor/thememanager.cpp
src/plugins/texteditor/thememanager.h
src/plugins/help/help_plg.cpp
src/plugins/help/help_plg.h
src/plugins/imageviewer/imageviewer_plg.cpp
src/plugins/imageviewer/imageviewer_plg.h
src/plugins/hexviewer/hexviewer_plg.cpp
src/plugins/hexviewer/hexviewer_plg.h
src/plugins/hexviewer/hextextoperationsadapter.cpp
src/plugins/hexviewer/hextextoperationsadapter.h
src/plugins/ProjectManager/BuildRunOutput.ui
src/plugins/ProjectManager/CompilerOutputDecoders.cpp
src/plugins/ProjectManager/CompilerOutputDecoders.h
src/plugins/ProjectManager/kitdefinitions.h
src/plugins/ProjectManager/kitdefinitions.cpp
src/plugins/ProjectManager/kitdefinitionmodel.h
src/plugins/ProjectManager/kitdefinitionmodel.cpp
src/plugins/ProjectManager/kitdetector.h
src/plugins/ProjectManager/kitdetector.cpp
src/plugins/ProjectManager/ProjectBuildConfig.cpp
src/plugins/ProjectManager/ProjectBuildConfig.h
src/plugins/ProjectManager/ProjectIssuesWidget.h
src/plugins/ProjectManager/ProjectIssuesWidget.cpp
src/plugins/ProjectManager/ProjectIssuesWidget.ui
src/plugins/ProjectManager/ProjectManagerPlg.cpp
src/plugins/ProjectManager/ProjectManagerPlg.h
src/plugins/ProjectManager/ProjectManagerGUI.ui
src/plugins/ProjectManager/ProjectSearch.cpp
src/plugins/ProjectManager/ProjectSearch.h
src/plugins/ProjectManager/ProjectSearchGUI.ui
src/plugins/CTags/CTagsPlugin.cpp
src/plugins/CTags/CTagsPlugin.hpp
src/plugins/CTags/CTagsLoader.cpp
src/plugins/CTags/CTagsLoader.hpp
src/plugins/SplitTabsPlugin/SplitTabsPlugin.cpp
src/plugins/SplitTabsPlugin/SplitTabsPlugin.hpp
src/plugins/git/CommitDelegate.hpp
src/plugins/git/CommitDelegate.cpp
src/plugins/git/CommitModel.hpp
src/plugins/git/CommitModel.cpp
src/plugins/git/CreateGitBranch.hpp
src/plugins/git/CreateGitBranch.cpp
src/plugins/git/CreateGitBranch.ui
src/plugins/git/GitCommands.ui
src/plugins/git/GitCommit.ui
src/plugins/git/GitPlugin.cpp
src/plugins/git/GitPlugin.hpp
src/plugins/git/CommitForm.cpp
src/plugins/git/CommitForm.hpp
src/plugins/git/CommitForm.ui
src/plugins/Terminal/TerminalPlugin.cpp
src/plugins/Terminal/TerminalPlugin.hpp
src/AnsiToHTML.cpp
src/AnsiToHTML.hpp
src/main.cpp
${CMAKE_BINARY_DIR}/codepointer.qrc
)
file(COPY "${CMAKE_SOURCE_DIR}/${ICON_NAME}.svg" DESTINATION "${CMAKE_BINARY_DIR}")
file(COPY "${CMAKE_SOURCE_DIR}/${ICON_NAME}.ico" DESTINATION "${CMAKE_BINARY_DIR}")
file(COPY "${CMAKE_SOURCE_DIR}/indenters.json" DESTINATION "${CMAKE_BINARY_DIR}")
configure_file(codepointer.qrc.in ${CMAKE_BINARY_DIR}/codepointer.qrc)
configure_file(codepointer.desktop.in ${CMAKE_BINARY_DIR}/${CODEPOINTER_APP_NAME}.desktop)
add_executable(codepointer WIN32 ${codepointer_sources} codepointer.rc
indenters.json)
if (!MINGW)
set_property(TARGET codepointerPROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
target_compile_definitions(codepointer PRIVATE -DCODEPOINTER_APP_NAME="${CODEPOINTER_APP_NAME}")
target_compile_definitions(codepointer PRIVATE -DCODEPOINTER_ICON=":${CODEPOINTER_ICON}.ico")
target_compile_definitions(codepointer PRIVATE -DCODEPOINTER_SVG_ICON=":${CODEPOINTER_ICON}.svg")
target_compile_definitions(codepointer PRIVATE -DCODEPOINTER_MACHINE_NAME="${CODEPOINTER_MACHINE_NAME}")
if(BUILD_VERSION STREQUAL "DEV")
target_compile_definitions(codepointer PRIVATE -DBUILD_DEV)
elseif(BUILD_VERSION STREQUAL "CE")
target_compile_definitions(codepointer PRIVATE -DBUILD_CE)
else()
target_compile_definitions(codepointer PRIVATE -DBUILD_OFFICIAL)
endif()
target_include_directories(codepointer PUBLIC
${qmdilib_SOURCE_DIR}/demos/plugin-demo
${qutepart_SOURCE_DIR}/include
src
)
target_link_libraries(codepointer PUBLIC Qt6::Core Qt6::Widgets Qt6::Concurrent Qt6::Network Qt6::Svg Qt6::Xml
qmdilib
qutepart
CommandPaletteWidget
KodoTerm::KodoTerm
Pal::ImageViewer
QHexView
QSimpleUpdater
QJsonModelStatic
)
set_target_properties(codepointer PROPERTIES OUTPUT_NAME ${CODEPOINTER_BINARY})
if(MSVC)
# if we don't do this - file will be under Debug/Relase subdir
set_target_properties(codepointer PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}$<0:>)
target_compile_options(codepointer PRIVATE /W4)
else()
set_target_properties(codepointer PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
target_compile_options(codepointer PRIVATE -Wall -Wextra -Wpedantic)
endif()
install(TARGETS codepointer
RUNTIME DESTINATION bin)
if (NOT CODEPOINTER_WORK_OFFLINE)
install(DIRECTORY ${CMAKE_BINARY_DIR}/share/
DESTINATION share/
DIRECTORY_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
endif()
if (WIN32)
install(FILES ${CMAKE_SOURCE_DIR}/${CODEPOINTER_ICON}.svg
DESTINATION /)
install(FILES ${CMAKE_SOURCE_DIR}/${CODEPOINTER_ICON}.ico
DESTINATION /)
else()
install(FILES ${CMAKE_SOURCE_DIR}/${CODEPOINTER_ICON}.svg
DESTINATION share/icons/hicolor/scalable/apps)
install(FILES ${CMAKE_BINARY_DIR}/${CODEPOINTER_APP_NAME}.desktop
DESTINATION share/applications
RENAME org.codepointerapp.${CODEPOINTER_APP_NAME}.desktop)
install(FILES ${CMAKE_SOURCE_DIR}/${CODEPOINTER_ICON}.svg
DESTINATION share/icons/hicolor/scalable/apps
RENAME org.codepointerapp.${CODEPOINTER_APP_NAME}.svg)
install(FILES org.codepointerapp.codepointer.appdata.xml
DESTINATION share/metainfo)
endif()