cmake: started monolithic build option

This commit is contained in:
Marc-André Moreau 2012-08-13 12:32:41 -04:00
parent 822242e86f
commit 6a49d43b4b
6 changed files with 58 additions and 23 deletions

View File

@ -14,6 +14,10 @@ if(MSVC)
option(WITH_NATIVE_SSPI "Use native SSPI modules" ON)
endif()
if(${CMAKE_VERSION} VERSION_GREATER 2.8.7)
option(WITH_MONOLITHIC_BUILD "Use monolithic build" OFF)
endif()
option(WITH_CLIENT "Build client binaries" ON)
option(WITH_SERVER "Build server binaries" OFF)
option(WITH_CHANNELS "Build virtual channel plugins" ON)

View File

@ -27,14 +27,23 @@ set(FREERDP_CACHE_SRCS
glyph.c
cache.c)
add_library(freerdp-cache ${FREERDP_CACHE_SRCS})
if(WITH_MONOLITHIC_BUILD)
add_library(freerdp-cache OBJECT ${FREERDP_CACHE_SRCS})
else()
add_library(freerdp-cache ${FREERDP_CACHE_SRCS})
endif()
set_target_properties(freerdp-cache PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
set(FREERDP_CACHE_LIBS
set(FREERDP_CACHE_LIBS)
if(WITH_MONOLITHIC_BUILD)
else()
set(FREERDP_CACHE_LIBS ${FREERDP_CACHE_LIBS}
freerdp-core
freerdp-utils)
target_link_libraries(freerdp-cache ${FREERDP_CACHE_LIBS})
install(TARGETS freerdp-cache DESTINATION ${CMAKE_INSTALL_LIBDIR})
target_link_libraries(freerdp-cache ${FREERDP_CACHE_LIBS})
install(TARGETS freerdp-cache DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

View File

@ -23,13 +23,22 @@ set(FREERDP_CHANNELS_SRCS
wtsvc.c
wtsvc.h)
add_library(freerdp-channels ${FREERDP_CHANNELS_SRCS})
if(WITH_MONOLITHIC_BUILD)
add_library(freerdp-channels OBJECT ${FREERDP_CHANNELS_SRCS})
else()
add_library(freerdp-channels ${FREERDP_CHANNELS_SRCS})
endif()
set_target_properties(freerdp-channels PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
set(FREERDP_CHANNELS_LIBS
set(FREERDP_CHANNELS_LIBS)
if(WITH_MONOLITHIC_BUILD)
else()
set(FREERDP_CHANNELS_LIBS ${FREERDP_CHANNELS_LIBS}
freerdp-utils)
target_link_libraries(freerdp-channels ${FREERDP_CHANNELS_LIBS})
install(TARGETS freerdp-channels DESTINATION ${CMAKE_INSTALL_LIBDIR})
target_link_libraries(freerdp-channels ${FREERDP_CHANNELS_LIBS})
install(TARGETS freerdp-channels DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

View File

@ -77,14 +77,23 @@ if(WITH_JPEG)
set(FREERDP_JPEG_LIBS jpeg)
endif()
add_library(freerdp-codec ${FREERDP_CODEC_SRCS})
if(WITH_MONOLITHIC_BUILD)
add_library(freerdp-codec OBJECT ${FREERDP_CODEC_SRCS})
else()
add_library(freerdp-codec ${FREERDP_CODEC_SRCS})
endif()
set_target_properties(freerdp-codec PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
set(FREERDP_CODEC_LIBS
freerdp-utils
${FREERDP_JPEG_LIBS})
target_link_libraries(freerdp-codec ${FREERDP_CODEC_LIBS})
if(WITH_MONOLITHIC_BUILD)
install(TARGETS freerdp-codec DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
set(FREERDP_CODEC_LIBS ${FREERDP_CODEC_LIBS}
freerdp-utils)
target_link_libraries(freerdp-codec ${FREERDP_CODEC_LIBS})
install(TARGETS freerdp-codec DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

View File

@ -119,4 +119,3 @@ set(FREERDP_CORE_LIBS ${FREERDP_CORE_LIBS} ${OPENSSL_LIBRARIES})
target_link_libraries(freerdp-core ${FREERDP_CORE_LIBS})
install(TARGETS freerdp-core DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -55,13 +55,18 @@ add_library(freerdp-utils ${FREERDP_UTILS_SRCS})
set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
target_link_libraries(freerdp-utils ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
set(FREERDP_UTILS_LIBS
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS})
if(WIN32)
target_link_libraries(freerdp-utils ws2_32)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
target_link_libraries(freerdp-utils rt)
set(FREERDP_UTILS_LIBS ${FREERDP_UTILS_LIBS} ws2_32)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES SunOS)
set(FREERDP_UTILS_LIBS ${FREERDP_UTILS_LIBS} rt)
endif()
target_link_libraries(freerdp-utils ${FREERDP_UTILS_LIBS})
install(TARGETS freerdp-utils DESTINATION ${CMAKE_INSTALL_LIBDIR})