Author: ivanovic
Date: Tue Apr  7 12:24:37 2009
New Revision: 34599

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34599&view=rev
Log:
add installation of .desktop files (and corresponding icons) to cmake recipe

Modified:
    trunk/CMakeLists.txt

Modified: trunk/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/CMakeLists.txt?rev=34599&r1=34598&r2=34599&view=diff
==============================================================================
--- trunk/CMakeLists.txt (original)
+++ trunk/CMakeLists.txt Tue Apr  7 12:24:37 2009
@@ -5,7 +5,6 @@
 # * Detect Python and install Python tools
 # * Rewrite the pot-update
 # * Test everything
-# * Install the .desktop files
 # * Fix tiny gui with processing the data directory
 # * Make translations work without installation
 
@@ -70,6 +69,11 @@
 option(ENABLE_NLS "Enable building of tranlations" ON)
 option(ENABLE_POOL_ALLOC "Enable custom pool malloc" OFF)
 option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" 
OFF)
+if (UNIX)
+  option(ENABLE_DESKTOP_ENTRY "enable installation of desktop entry files" ON)
+  set(ICONDIR "${DATAROOTDIR}/pixmaps" CACHE STRING "Sets the icon directory 
for desktop entry to a non-default location.")
+  set(DESKTOPDIR "${DATAROOTDIR}/applications/" CACHE STRING "Sets the desktop 
file directory for desktop entry to a non-default location.")
+endif(UNIX)
 
 #misc options
 if(NOT MSVC)
@@ -255,6 +259,19 @@
 
 endif()
 
+#
+# Install .desktop entries
+#
+if(ENABLE_DESKTOP_ENTRY)
+  # install a desktop file so wesnoth appears in the application start menu 
with an icon
+  install(FILES icons/wesnoth.desktop DESTINATION ${DESKTOPDIR} )
+  install(FILES icons/wesnoth-icon.png DESTINATION ${ICONDIR} )
+  if(ENABLE_EDITOR)
+    install(FILES icons/wesnoth_editor.desktop DESTINATION ${DESKTOPDIR} )
+    install(FILES icons/wesnoth_editor-icon.png DESTINATION ${ICONDIR} )
+  endif(ENABLE_EDITOR)
+endif(ENABLE_DESKTOP_ENTRY)
+
 
 if(ENABLE_SERVER AND FIFO_DIR)
   install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory 
\$ENV{DESTDIR}/${FIFO_DIR})")


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to