wfreerdp: fix building against OpenSSL with MONOLITHIC_BUILD and shared libraries

This commit is contained in:
Marc-André Moreau 2014-02-01 19:53:45 -05:00
parent 9bdfbcd556
commit b5bef07e50
5 changed files with 15 additions and 18 deletions

View File

@ -18,9 +18,6 @@
set(MODULE_NAME "freerdp-client") set(MODULE_NAME "freerdp-client")
set(MODULE_PREFIX "FREERDP_CLIENT") set(MODULE_PREFIX "FREERDP_CLIENT")
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${ZLIB_INCLUDE_DIRS})
set(${MODULE_PREFIX}_SRCS set(${MODULE_PREFIX}_SRCS
client.c client.c
cmdline.c cmdline.c
@ -40,6 +37,9 @@ endif()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${ZLIB_INCLUDE_DIRS})
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib") set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib")
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS}
@ -53,7 +53,10 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI
MODULE winpr MODULE winpr
MODULES winpr-crt winpr-utils) MODULES winpr-crt winpr-utils)
set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "") if(NOT WIN32)
set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
set_target_properties(${MODULE_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES "")
endif()
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS}) target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})

View File

@ -143,14 +143,10 @@ IF(WIN32 AND NOT CYGWIN)
"lib/VC" "lib/VC"
) )
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) set( OPENSSL_DEBUG_LIBRARIES ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG} )
set( OPENSSL_LIBRARIES set( OPENSSL_RELEASE_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
optimized ${SSL_EAY_RELEASE} debug ${SSL_EAY_DEBUG} set( OPENSSL_LIBRARIES ${OPENSSL_RELEASE_LIBRARIES} )
optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG}
)
else()
set( OPENSSL_LIBRARIES ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE} )
endif()
MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE) MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE)
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE) MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
ELSEIF(MINGW) ELSEIF(MINGW)
@ -322,4 +318,4 @@ else (OPENSSL_VERSION)
) )
endif (OPENSSL_VERSION) endif (OPENSSL_VERSION)
MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES) MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES OPENSSL_DEBUG_LIBRARIES OPENSSL_RELEASE_LIBRARIES)

View File

@ -91,8 +91,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
set(WINPR_INCLUDE_DIR "include") set(WINPR_INCLUDE_DIR "include")
set(WINPR_MONOLITHIC_BUILD ${MONOLITHIC_BUILD}) set(WINPR_MONOLITHIC_BUILD ${MONOLITHIC_BUILD})
message(STATUS "WINPR_VERSION: ${WINPR_VERSION}")
configure_package_config_file(WinPRConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/WinPRConfig.cmake configure_package_config_file(WinPRConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/WinPRConfig.cmake
INSTALL_DESTINATION ${WINPR_CMAKE_INSTALL_DIR} INSTALL_DESTINATION ${WINPR_CMAKE_INSTALL_DIR}
PATH_VARS WINPR_INCLUDE_DIR WINPR_MONOLITHIC_BUILD) PATH_VARS WINPR_INCLUDE_DIR WINPR_MONOLITHIC_BUILD)

View File

@ -45,12 +45,14 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MODULE winpr MODULE winpr
MODULES winpr-crt winpr-utils) MODULES winpr-crt winpr-utils)
message(STATUS "OPENSSL_LIBRARIES: ${OPENSSL_LIBRARIES} ZLIB_LIBRARIES: ${ZLIB_LIBRARIES}")
if(WIN32) if(WIN32)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} crypt32) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} crypt32)
endif() endif()
if(MONOLITHIC_BUILD) if(MONOLITHIC_BUILD)
set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
else() else()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets) install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT WinPRTargets)
endif() endif()

View File

@ -74,8 +74,6 @@ set(${MODULE_PREFIX}_LIBS
if(WIN32) if(WIN32)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32) set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ws2_32)
else()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${ZLIB_LIBRARIES})
endif() endif()
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS