Fix CMake Package and DBUS Names (#819)

* Fix CMake Packaging to properly package assets.
This commit is contained in:
borgmanJeremy
2020-09-04 19:29:37 -05:00
committed by GitHub
parent 3cad32d38e
commit c0e2e48db4
5 changed files with 34 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.13)
#cmake_policy(SET CMP0076 OLD)
project(
flameshot

View File

@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.dharkael.Flameshot
Name=org.flameshot.Flameshot
Exec=/usr/local/bin/flameshot

View File

@@ -1,6 +1,6 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.dharkael.Flameshot">
<interface name="org.flameshot.Flameshot">
<!--
graphicCapture:

View File

@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.dharkael.Flameshot
Name=org.flameshot.Flameshot
Exec=/usr/bin/flameshot

View File

@@ -121,7 +121,37 @@ endforeach()
include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Flameshot)
# Install binary
install(
TARGETS flameshot
EXPORT flameshot-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Install desktop files, completion and dbus files
configure_file(${CMAKE_SOURCE_DIR}/docs/desktopEntry/package/flameshot.desktop
${CMAKE_CURRENT_BINARY_DIR}/share/applications/flameshot.desktop COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/docs/bash-completion/flameshot
${CMAKE_CURRENT_BINARY_DIR}/share/bash-completions/completions/flameshot COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/data/dbus/org.flameshot.Flameshot.xml
${CMAKE_CURRENT_BINARY_DIR}/share/dbus-1/interfaces/org.flameshot.Flameshot.xml COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/data/dbus/package/org.flameshot.Flameshot.service
${CMAKE_CURRENT_BINARY_DIR}/share/dbus-1/services/org.flameshot.Flameshot.service COPYONLY)
# Install Icons
configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/48x48/apps/flameshot.png
${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/48x48/apps/flameshot.png COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/128x128/apps/flameshot.png
${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/128x128/apps/flameshot.png COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/scalable/apps/flameshot.svg
${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/scalable/apps/flameshot.svg COPYONLY)
# Install assets
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/share/ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR})
# Install Translations
install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/flameshot/translations)