[client,common] add WITH_INSTALL_CLIENT_DESKTOP_FILES

This new CMake option allows installing .desktop files and application
icons if turned on.
This commit is contained in:
akallabeth 2024-08-09 14:56:06 +02:00
parent 5538681fc3
commit c377b0ce86
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
8 changed files with 74 additions and 0 deletions

View File

@ -18,6 +18,7 @@
# Clients
include(CMakeDependentOption)
include(InstallFreeRDPDesktop)
if(WITH_CLIENT_COMMON)
add_subdirectory(common)

View File

@ -77,5 +77,6 @@ if (NOT WITH_CLIENT_SDL_VERSIONED)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
install_freerdp_desktop("${MODULE_NAME}")
add_subdirectory(man)

View File

@ -76,5 +76,6 @@ if (NOT WITH_CLIENT_SDL_VERSIONED)
)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
install_freerdp_desktop("${MODULE_NAME}" "${MODULE_NAME}")
add_subdirectory(man)

View File

@ -56,3 +56,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/Sample")
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
install_freerdp_desktop("${PROJECT_NAME}")

View File

@ -29,6 +29,7 @@ list(APPEND LIBS
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBS})
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
install_freerdp_desktop("${MODULE_NAME}")
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/X11")

View File

@ -0,0 +1,39 @@
include(GNUInstallDirs)
option(WITH_INSTALL_CLIENT_DESKTOP_FILES "Install .desktop files for clients" OFF)
set(DESKTOP_RESOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../resources" CACHE INTERNAL "")
function(install_freerdp_desktop name)
if(WITH_INSTALL_CLIENT_DESKTOP_FILES)
get_target_property(FREERDP_APP_NAME ${name} OUTPUT_NAME)
set(FREERDP_BIN_NAME "${CMAKE_INSTALL_FULL_BINDIR}/${FREERDP_APP_NAME}")
set(FREERDP_DESKTOP_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}.desktop")
set(FREERDP_DESKTOP_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${FREERDP_BIN_NAME}-file.desktop")
configure_file(
${DESKTOP_RESOURCE_DIR}/freerdp.desktop.template
${FREERDP_DESKTOP_NAME}
@ONLY
)
configure_file(
${DESKTOP_RESOURCE_DIR}/freerdp-file.desktop.template
${FREERDP_DESKTOP_FILE_NAME}
@ONLY
)
install(
FILES
${FREERDP_DESKTOP_NAME}
${FREERDP_DESKTOP_FILE_NAME}
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/applications
)
install(
FILES
${DESKTOP_RESOURCE_DIR}/FreeRDP_Icon.svg
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
RENAME
FreeRDP.svg
)
endif()
endfunction()

View File

@ -0,0 +1,16 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=@FREERDP_APP_NAME@
Comment=Access remote desktops with FreeRDP
Categories=GTK;GNOME;X-GNOME-NetworkSettings;Network;
Keywords=remote desktop;rdp;
TryExec=@FREERDP_BIN_NAME@
Exec=@FREERDP_BIN_NAME@ %U
Icon=FreeRDP
MimeType=x-scheme-handler/rdp;
Actions=Edit;
Terminal=true
StartupNotify=true
NoDisplay=true
X-Desktop-File-Install-Version=0.24

View File

@ -0,0 +1,14 @@
[Desktop Entry]
Name=@FREERDP_APP_NAME@
X-GNOME-FullName=FreeRDP Remote Desktop Client
GenericName=FreeRDP RDP Client
Comment=Connect to RDP servers for remote work or administration
Exec=@FREERDP_BIN_NAME@
Icon=FreeRDP
Terminal=true
Type=Application
Keywords=remote desktop;rdp;
Categories=GTK;GNOME;X-GNOME-NetworkSettings;Network;
MimeType=x-scheme-handler/rdp;
StartupNotify=true
StartupWMClass=com.freerdp.FreeRDP