If -DBUILTIN_CHANNELS=OFF is supplied to cmake, auxiliary channel modules
are built as plugins, that are loaded from $LIBDIR/freerdp as shared libs.
This patch fixes the linkage of these plugins by taking inter-channel dependencies
of this separation into account. If BUILTIN_CHANNELS=ON, these channel modules
are linked directly into the main modules. Therefore, the linking of the plugins
is conditioned accordingly.
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.
Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
rdp2tcp was wrongly exposed as cmake target. This could lead to errors
like the following when the FreeRDP2 cmake file was required:
CMake Error at ../lib/cmake/FreeRDP2/FreeRDPTargets.cmake:73 (message):
The imported target "rdp2tcp-client" references the file
".../lib/freerdp2/librdp2tcp-client.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
".../lib/cmake/FreeRDP2/FreeRDPTargets.cmake"
but not all the files it references.