Commit ab2a1a3a authored by Harald Sitter's avatar Harald Sitter
Browse files

revise VNC/RDP option selection

the RDP side of things was actually confusingly wrong as it was tagged
RUNTIME but was required at buildtime. this was because we have the
buildtime stuff doubling as feature selectors. this is a bit meh and
indeed a similar case was discussed a while ago in #kde-devel with the
conclusion mostly being that optional deps are meh and opting out of
stuff is probably much more expressive.

so. this commit make the user opt out of features rather than enabling
them when dependencies are available.

cmake options WITH_VNC and WITH_RDP now control the relevant feature
sets. they are both enabled by default. when disabled the relevant deps
aren't being looked for anymore, still enabling the user to opt out of a
given feature set.
this then also frees up freerdp's package to be proper RUNTIME because
the feature enabling is controlled by the option, not the presence.

both options also express themselves in the feature summary to further
aid expressiveness and discoverability of the...
parent 810e9bd6
......@@ -64,42 +64,43 @@ if(WIN32)
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
endif(WIN32)
find_package(LibVNCServer)
set_package_properties("libvncserver" PROPERTIES
DESCRIPTION "VNC server / client library"
URL "http://libvncserver.sourceforge.net/"
PURPOSE "Needed to build VNC client support in KRDC"
)
find_package(LibSSH)
set_package_properties("libssh" PROPERTIES
DESCRIPTION "ssh library"
URL "https://libssh.org/"
PURPOSE "Needed to build VNC+SSH tunnel support "
)
option(WITH_VNC "Enable VNC support." ON)
add_feature_info(VNC WITH_VNC "Building with support for the VNC protocol. Disable with -DWITH_VNC=NO")
option(WITH_RDP "Enable RDP support. Has additional runtime binary requirements!" ON)
add_feature_info(RDP WITH_RDP "Building with support for the RDP protocol. Disable with -DWITH_RDP=NO")
# Needs porting
find_program(FREERDP_EXECUTABLE xfreerdp)
if(FREERDP_EXECUTABLE)
set(FREERDP_FOUND true) # mark the package found
set(FREERDP_EXECUTABLE_FOUND true)
endif(FREERDP_EXECUTABLE)
add_subdirectory(core)
# dud to allow the dep showing up in feature summary.
# note that this must be after _FOUND is set so it doesn't incorrectly
# set the metadata to not-found.
find_package(freerdp QUIET)
if(WITH_VNC)
find_package(LibVNCServer)
set_package_properties(LibVNCServer PROPERTIES
DESCRIPTION "VNC server / client library"
URL "http://libvncserver.sourceforge.net/"
PURPOSE "Needed to build VNC client support in KRDC"
TYPE REQUIRED
)
find_package(LibSSH)
set_package_properties(LibSSH PROPERTIES
DESCRIPTION "ssh library"
URL "https://libssh.org/"
PURPOSE "Needed to build VNC+SSH tunnel support "
TYPE OPTIONAL
)
add_subdirectory(vnc)
endif()
set_package_properties(freerdp PROPERTIES
if(WITH_RDP)
find_package(xfreerdp)
set_package_properties(xfreerdp PROPERTIES
DESCRIPTION "A free Remote Desktop Protocol (RDP) Implementation"
URL "https://www.freerdp.com/"
PURPOSE "The xfreerdp binary is needed for RDP support in KRDC (at runtime)"
TYPE RUNTIME
)
)
add_subdirectory(rdp)
endif()
add_subdirectory(core)
add_subdirectory(vnc)
add_subdirectory(rdp)
add_subdirectory(test)
if(KF5DocTools_FOUND)
......
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2021 Harald Sitter <sitter@kde.org>
find_program(${CMAKE_FIND_PACKAGE_NAME}_PATH xfreerdp)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME}
FOUND_VAR ${CMAKE_FIND_PACKAGE_NAME}_FOUND
REQUIRED_VARS ${CMAKE_FIND_PACKAGE_NAME}_PATH
)
mark_as_advanced(${CMAKE_FIND_PACKAGE_NAME}_PATH)
if(NOT FREERDP_EXECUTABLE_FOUND)
return()
endif()
add_library(krdc_rdpplugin)
target_sources(krdc_rdpplugin PRIVATE
......
if(NOT LIBVNCSERVER_FOUND)
return()
endif()
add_library(krdc_vncplugin)
target_sources(krdc_vncplugin PRIVATE
......
Markdown is supported
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