Fix channel linking for built in channels

This commit is contained in:
Armin Novak 2019-12-03 14:51:13 +01:00 committed by akallabeth
parent f933cafa93
commit f77b3daaa0

View File

@ -167,7 +167,12 @@ macro(client_channel_install _targets _destination)
endmacro(client_channel_install) endmacro(client_channel_install)
macro(add_channel_client_library _module_prefix _module_name _channel_name _dynamic _entry) 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. # On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt # Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32) 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) set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif() endif()
add_library(${_module_name} ${${_module_prefix}_SRCS}) add_library(${_module_name} ${${_module_prefix}_SRCS})
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
else() client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
set(${_module_prefix}_STATIC ON PARENT_SCOPE) else()
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE) set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE) set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE)
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE)
if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS) add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
endif()
endif() 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) endmacro(add_channel_client_library)
macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_name _type _dynamic _entry) 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. # On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt # Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32) 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) set ( ${_module_prefix}_SRCS ${${_module_prefix}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif() endif()
add_library(${_module_name} ${${_module_prefix}_SRCS}) add_library(${_module_name} ${${_module_prefix}_SRCS})
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
else() client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
set(${_module_prefix}_STATIC ON PARENT_SCOPE) else()
set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE) set(${_module_prefix}_STATIC ON PARENT_SCOPE)
set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE) set(${_module_prefix}_NAME ${_module_name} PARENT_SCOPE)
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS}) set(${_module_prefix}_TYPE ${_type} PARENT_SCOPE)
if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH}) add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
endif() target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
endif() 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) endmacro(add_channel_client_subsystem_library)
macro(add_channel_server_library _module_prefix _module_name _channel_name _dynamic _entry) 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. # On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt # Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32) if (WIN32)