From 0a126cf80999a49eca25be68e95465d8c5169bf4 Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Sun, 7 Aug 2016 08:38:15 +0200 Subject: [PATCH] Generate cura.desktop (#668) Adds support to install Cura to an alternative path, while generating a correct .desktop file for it. * Renaming cura.desktop to cura.desktop.in * CMAKE: Generate .desktop from .desktop.in * Replace hardcoded paths with FULL_PATHs * Tell CMake to generate cura.desktop * CMake: Set full paths for .desktop generation * It tells CMake where to find the .desktop.in is and where to store the result. --- CMakeLists.txt | 3 ++- cura.desktop => cura.desktop.in | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) rename cura.desktop => cura.desktop.in (77%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40d94135ce..40fac2ca2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ add_custom_command(TARGET tests POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DI set(CURA_VERSION "master" CACHE STRING "Version name of Cura") set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") +configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY) configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY) # Macro needed to list all sub-directory of a directory. @@ -76,7 +77,7 @@ if(NOT APPLE AND NOT WIN32) FILES_MATCHING PATTERN *.py) install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages/cura) - install(FILES cura.desktop + install(FILES ${CMAKE_BINARY_DIR}/cura.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES cura.sharedmimeinfo DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/ diff --git a/cura.desktop b/cura.desktop.in similarity index 77% rename from cura.desktop rename to cura.desktop.in index 8e02fe6d52..0ac25c9521 100644 --- a/cura.desktop +++ b/cura.desktop.in @@ -5,9 +5,9 @@ Name[de]=Cura GenericName=3D Printing Software GenericName[de]=3D-Druck-Software Comment=Cura converts 3D models into paths for a 3D printer. It prepares your print for maximum accuracy, minimum printing time and good reliability with many extra features that make your print come out great. -Exec=/usr/bin/cura %F -TryExec=/usr/bin/cura -Icon=/usr/share/cura/resources/images/cura-icon.png +Exec=@CMAKE_INSTALL_FULL_BINDIR@/cura %F +TryExec=@CMAKE_INSTALL_FULL_BINDIR@/cura +Icon=@CMAKE_INSTALL_FULL_DATADIR@/cura/resources/images/cura-icon.png Terminal=false Type=Application MimeType=application/sla;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;image/bmp;image/gif;image/jpeg;image/png