From 05e8679b99a0aab2d6510d061dc4057cdf8a97d2 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Dec 2015 23:49:54 -0800 Subject: [PATCH] Install desktop file in a portable, build-dir-independent way Install location matches http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html Previous process of installation would attempt to create a directory before the install process, preventing usage in something like the Arch User Repository. This also removes the need to workaround any bugs present with desktop file installation tools. --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc6e2b..57e2f81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,7 @@ project (${project_name}) add_subdirectory("src") -find_program(XDG_DESKTOP_MENU_EXECUTABLE xdg-desktop-menu) -if(XDG_DESKTOP_MENU_EXECUTABLE) - file(MAKE_DIRECTORY "/usr/share/desktop-directories") #Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730621 - install(CODE "execute_process(COMMAND ${XDG_DESKTOP_MENU_EXECUTABLE} install --novendor share/juci.desktop)") +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") + install(FILES "${CMAKE_SOURCE_DIR}/share/juci.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") endif()