cmake: XDG desktop integration
authorThomas Debesse <dev@illwieckz.net>
Sun, 16 Jul 2017 01:53:36 +0000 (03:53 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 18 May 2019 20:47:42 +0000 (22:47 +0200)
- desktop file
- application icon
- map mime type

CMakeLists.txt
icons/mime/map.xml [new file with mode: 0644]
icons/netradiant.desktop [new file with mode: 0755]
icons/netradiant.png [new file with mode: 0644]
icons/radiant-src.png [deleted file]

index 1336f3b..4e4bafc 100644 (file)
@@ -23,9 +23,9 @@ set(RADIANT_BIN_SUBDIR . CACHE INTERNAL "...")
 set(RADIANT_DATA_SUBDIR . CACHE INTERNAL "...")
 
 if (STANDARD_INSTALL)
-       set(RADIANT_LIB_SUBDIR lib/${RADIANT_BASENAME})
-       set(RADIANT_BIN_SUBDIR bin)
-       set(RADIANT_DATA_SUBDIR share/${RADIANT_BASENAME})
+    set(RADIANT_LIB_SUBDIR lib/${RADIANT_BASENAME})
+    set(RADIANT_BIN_SUBDIR bin)
+    set(RADIANT_DATA_SUBDIR share/${RADIANT_BASENAME})
 endif ()
 
 #-----------------------------------------------------------------------
@@ -281,8 +281,7 @@ endif()
 # Install
 #-----------------------------------------------------------------------
 
-install(
-        DIRECTORY
+install(DIRECTORY
         setup/data/tools/
         docs
         DESTINATION ${RADIANT_DATA_SUBDIR}/.
@@ -291,4 +290,19 @@ install(
 install(CODE "execute_process(COMMAND \"${PROJECT_SOURCE_DIR}/gamepack-manager\" --license ${GAMEPACKS_LICENSE_LIST} --name ${GAMEPACKS_NAME_LIST} --download-dir \"${PROJECT_BINARY_DIR}/download\" --install-dir \"${CMAKE_INSTALL_PREFIX}/${RADIANT_DATA_SUBDIR}\" --install)"
 )
 
+if(NOT WIN32 AND NOT APPLE AND STANDARD_INSTALL)
+    install(FILES
+        ${PROJECT_SOURCE_DIR}/icons/netradiant.png
+        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps
+    )
+    install(FILES
+        ${PROJECT_SOURCE_DIR}/icons/netradiant.desktop
+        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
+    )
+    install(FILES
+        ${PROJECT_SOURCE_DIR}/icons/mime/map.xml
+        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/model
+    )
+endif()
+
 include(cmake/scripts/package.cmake)
diff --git a/icons/mime/map.xml b/icons/mime/map.xml
new file mode 100644 (file)
index 0000000..f206bdb
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+    <mime-type type="model/map">
+    <generic-icon name="text-x-generic"/>
+    <sub-class-of type="text/plain"/>
+    <comment>Game level source</comment>
+    <glob pattern="*.map"/>
+  </mime-type>
+</mime-info>
diff --git a/icons/netradiant.desktop b/icons/netradiant.desktop
new file mode 100755 (executable)
index 0000000..593510e
--- /dev/null
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=1.5.0
+Name=NetRadiant
+GenericName=Level editor
+Comment=3D level editor for id Tech based games
+Icon=netradiant
+Exec=netradiant %f
+Terminal=false
+Type=Application
+MimeType=application/x-netradiant-map;
+Categories=Game;Graphics;3DGraphics;
+Keywords=darkplaces,nexuiz,openarena,osirion,quake,quake2,quake3,quetoo,tremulous,ufoai,unvanquished,warsow,xonotic,idtech;level;map;game development;
diff --git a/icons/netradiant.png b/icons/netradiant.png
new file mode 100644 (file)
index 0000000..720e985
Binary files /dev/null and b/icons/netradiant.png differ
diff --git a/icons/radiant-src.png b/icons/radiant-src.png
deleted file mode 100644 (file)
index 720e985..0000000
Binary files a/icons/radiant-src.png and /dev/null differ