diff --git a/channels/CMakeLists.txt b/channels/CMakeLists.txt index 76a571692..b006448c7 100644 --- a/channels/CMakeLists.txt +++ b/channels/CMakeLists.txt @@ -167,7 +167,12 @@ macro(client_channel_install _targets _destination) endmacro(client_channel_install) macro(add_channel_client_library _module_prefix _module_name _channel_name _dynamic _entry) - if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if (NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) # On windows create dll version information. # Vendor, product and year are already set in top level CMakeLists.txt if (WIN32) @@ -185,22 +190,30 @@ macro(add_channel_client_library _module_prefix _module_name _channel_name _dyna set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif() - add_library(${_module_name} ${${_module_prefix}_SRCS}) - client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) - else() - set(${_module_prefix}_STATIC ON PARENT_SCOPE) - set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) - set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) - set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) - add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) - if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS) - client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) - endif() - endif() + add_library(${_module_name} ${${_module_prefix}_SRCS}) + target_link_libraries(${_module_name} ${${_module_prefix}_LIBS}) + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) + else() + set(${_module_prefix}_STATIC ON PARENT_SCOPE) + set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) + set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) + set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) + add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) + target_link_libraries(${_module_name} ${${_module_prefix}_LIBS}) + + if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS) + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) + endif() + endif() endmacro(add_channel_client_library) macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_name _type _dynamic _entry) - if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if (NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) # On windows create dll version information. # Vendor, product and year are already set in top level CMakeLists.txt if (WIN32) @@ -218,21 +231,29 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_ set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif() - add_library(${_module_name} ${${_module_prefix}_SRCS}) - client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) - else() - set(${_module_prefix}_STATIC ON PARENT_SCOPE) - set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) - set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE) - add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) - if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS) - client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) - endif() - endif() + add_library(${_module_name} ${${_module_prefix}_SRCS}) + target_link_libraries(${_module_name} ${${_module_prefix}_LIBS}) + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) + else() + set(${_module_prefix}_STATIC ON PARENT_SCOPE) + set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) + set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE) + + add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) + target_link_libraries(${_module_name} ${${_module_prefix}_LIBS}) + if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS) + client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) + endif() + endif() endmacro(add_channel_client_subsystem_library) macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry) - if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) + set(_lnk_dir ${${_module_prefix}_LINK_DIRS}) + if (NOT "${_lnk_dir}" STREQUAL "") + link_directories(${_lnk_dir}) + endif() + + if(${_dynamic} AND (NOT BUILTIN_CHANNELS)) # On windows create dll version information. # Vendor, product and year are already set in top level CMakeLists.txt if (WIN32)