add installation of .desktop files (and corresponding icons) to cmake recipe

This commit is contained in:
Nils Kneuper 2009-04-07 10:24:37 +00:00
parent 5409fddd22
commit 00f743de79

View file

@ -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_TESTS "Build unit tests")
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 @@ else()
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})")