Browse Source

Fix CMake Package and DBUS Names (#819)

* Fix CMake Packaging to properly package assets.
borgmanJeremy 4 years ago
parent
commit
c0e2e48db4

+ 1 - 0
CMakeLists.txt

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

+ 1 - 1
data/dbus/make/org.dharkael.Flameshot.service

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

+ 1 - 1
data/dbus/org.dharkael.Flameshot.xml → data/dbus/org.flameshot.Flameshot.xml

@@ -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:

+ 1 - 1
data/dbus/package/org.dharkael.Flameshot.service → data/dbus/package/org.flameshot.Flameshot.service

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

+ 30 - 0
src/CMakeLists.txt

@@ -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)