@@ -216,9 +216,11 @@ endif()
216
216
message ("Flameshot predefined color palette large: " ${FLAMESHOT_PREDEFINED_COLOR_PALETTE_LARGE} )
217
217
target_compile_definitions (fireshot PRIVATE PREDEFINED_COLOR_PALETTE_LARGE=${FLAMESHOT_PREDEFINED_COLOR_PALETTE_LARGE} )
218
218
219
+ # 查找git并获取git版本以及当前目录的hash值
219
220
find_package (Git)
220
221
if (GIT_FOUND)
221
222
message ("git found: ${GIT_EXECUTABLE} in version ${GIT_VERSION_STRING} " )
223
+ # git rev-parse --short HEAD
222
224
execute_process (COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_VARIABLE FLAMESHOT_GIT_HASH)
223
225
string (REGEX REPLACE "\r *\n $" "" FLAMESHOT_GIT_HASH "${FLAMESHOT_GIT_HASH} " )
224
226
target_compile_definitions (fireshot PRIVATE FLAMESHOT_GIT_HASH="${FLAMESHOT_GIT_HASH} " )
@@ -227,16 +229,15 @@ else()
227
229
target_compile_definitions (fireshot PRIVATE FLAMESHOT_GIT_HASH="-" )
228
230
message ("git command is not found" )
229
231
endif ()
232
+
233
+
230
234
target_compile_definitions (fireshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX} " )
231
235
target_compile_definitions (fireshot PRIVATE APP_VERSION="v${PROJECT_VERSION} " )
232
236
233
237
if (FLAMESHOT_DEBUG_CAPTURE)
234
238
target_compile_definitions (fireshot PRIVATE FLAMESHOT_DEBUG_CAPTURE)
235
239
endif ()
236
240
237
- if (USE_MONOCHROME_ICON)
238
- target_compile_definitions (fireshot PRIVATE USE_MONOCHROME_ICON)
239
- endif ()
240
241
241
242
foreach (FILE ${QM_FILES} )
242
243
get_filename_component (F_NAME ${FILE} NAME )
@@ -265,59 +266,6 @@ install(TARGETS fireshot
265
266
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
266
267
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
267
268
268
- if (UNIX )
269
- # Install desktop files, completion and dbus files
270
- configure_file (${CMAKE_SOURCE_DIR} /data/desktopEntry/package/org.fireshot.Flameshot.desktop
271
- ${CMAKE_CURRENT_BINARY_DIR} /share/applications/org.fireshot.Flameshot.desktop @ONLY)
272
-
273
- configure_file (${CMAKE_SOURCE_DIR} /data/appdata/org.fireshot.Flameshot.metainfo.xml
274
- ${CMAKE_CURRENT_BINARY_DIR} /share/metainfo/org.fireshot.Flameshot.metainfo.xml COPYONLY )
275
-
276
- configure_file (${CMAKE_SOURCE_DIR} /data/shell-completion/fireshot.bash
277
- ${CMAKE_CURRENT_BINARY_DIR} /share/bash-completion/completions/fireshot COPYONLY )
278
-
279
- configure_file (${CMAKE_SOURCE_DIR} /data/shell-completion/fireshot.zsh
280
- ${CMAKE_CURRENT_BINARY_DIR} /share/zsh/site-functions/_flameshot COPYONLY )
281
-
282
- configure_file (${CMAKE_SOURCE_DIR} /data/shell-completion/fireshot.fish
283
- ${CMAKE_CURRENT_BINARY_DIR} /share/fish/vendor_completions.d/fireshot.fish COPYONLY )
284
-
285
- configure_file (${CMAKE_SOURCE_DIR} /data/dbus/org.fireshot.Flameshot.xml
286
- ${CMAKE_CURRENT_BINARY_DIR} /share/dbus-1/interfaces/org.fireshot.Flameshot.xml COPYONLY )
287
-
288
- configure_file (${CMAKE_SOURCE_DIR} /data/dbus/org.fireshot.Flameshot.service.in
289
- ${CMAKE_CURRENT_BINARY_DIR} /share/dbus-1/services/org.fireshot.Flameshot.service)
290
-
291
- # Install man pages
292
- configure_file (${CMAKE_SOURCE_DIR} /data/man/man1/fireshot.1
293
- ${CMAKE_CURRENT_BINARY_DIR} /share/man/man1/fireshot.1 COPYONLY )
294
-
295
- # Install Icons
296
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/48x48/apps/org.fireshot.Flameshot.png
297
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/48x48/apps/org.fireshot.Flameshot.png COPYONLY )
298
-
299
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/128x128/apps/org.fireshot.Flameshot.png
300
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/128x128/apps/org.fireshot.Flameshot.png COPYONLY )
301
-
302
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/scalable/apps/org.fireshot.Flameshot.svg
303
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/scalable/apps/org.fireshot.Flameshot.svg COPYONLY )
304
-
305
- # Install icon with both names
306
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/48x48/apps/fireshot.png
307
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/48x48/apps/fireshot.png COPYONLY )
308
-
309
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/128x128/apps/fireshot.png
310
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/128x128/apps/fireshot.png COPYONLY )
311
-
312
- configure_file (${CMAKE_SOURCE_DIR} /data/img/hicolor/scalable/apps/fireshot.svg
313
- ${CMAKE_CURRENT_BINARY_DIR} /share/icons/hicolor/scalable/apps/fireshot.svg COPYONLY )
314
-
315
- # Install assets
316
- install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /share/ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} )
317
-
318
- # Install Translations
319
- install (FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} /fireshot/translations)
320
- endif ()
321
269
322
270
# windeployqt
323
271
if (WIN32 )
0 commit comments