Commit 0e851f2b authored by Antonio Rojas's avatar Antonio Rojas
Browse files

Make .deb and .rpm mime type handling optional at build time

Only add support for them if the dpkg or rpm executables are present, respectively.

Differential Revision: https://phabricator.kde.org/D13123
parent ee8e4942
......@@ -38,7 +38,15 @@ install(TARGETS plasma-discover ${INSTALL_TARGETS_DEFAULT_ARGS} )
# Standard desktop file accepts local files as input.
set(DesktopNoDisplay "false")
set(DesktopMimeType "application/vnd.debian.binary-package;application/x-rpm;")
find_program(DPKG dpkg)
find_program(RPM rpm)
set(DesktopMimeType "")
if(DPKG)
set(DesktopMimeType "${DesktopMimeType}application/vnd.debian.binary-package;")
endif()
if(RPM)
set(DesktopMimeType "${DesktopMimeType}application/x-rpm;")
endif()
set(DesktopExec "plasma-discover %F")
configure_file(org.kde.discover.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.discover.desktop)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.discover.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment