cmake: make linking type as option.

This commit is contained in:
Rex Tsai 2011-09-01 22:18:58 +08:00
parent 093ed8383a
commit ecbe24ca9a
20 changed files with 24 additions and 19 deletions

View File

@ -51,6 +51,11 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()
# build shared libs
if(NOT BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
# Compiler-specific flags
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable")

View File

@ -25,7 +25,7 @@ set(CLIPRDR_SRCS
cliprdr_main.h
)
add_library(cliprdr SHARED ${CLIPRDR_SRCS})
add_library(cliprdr ${CLIPRDR_SRCS})
set_target_properties(cliprdr PROPERTIES PREFIX "")
target_link_libraries(cliprdr freerdp-utils)

View File

@ -25,7 +25,7 @@ set(DRDYNVC_SRCS
dvcman.h
)
add_library(drdynvc SHARED ${DRDYNVC_SRCS})
add_library(drdynvc ${DRDYNVC_SRCS})
set_target_properties(drdynvc PROPERTIES PREFIX "")
target_link_libraries(drdynvc freerdp-utils)

View File

@ -23,7 +23,7 @@ set(RAIL_SRCS
rail_orders.c
rail_orders.h)
add_library(rail SHARED ${RAIL_SRCS})
add_library(rail ${RAIL_SRCS})
set_target_properties(rail PROPERTIES PREFIX "")
target_link_libraries(rail freerdp-utils)

View File

@ -21,7 +21,7 @@ set(RDPDBG_SRCS
rdpdbg_main.c
)
add_library(rdpdbg SHARED ${RDPDBG_SRCS})
add_library(rdpdbg ${RDPDBG_SRCS})
set_target_properties(rdpdbg PROPERTIES PREFIX "")
target_link_libraries(rdpdbg freerdp-utils)

View File

@ -30,7 +30,7 @@ set(RDPDR_SRCS
rdpdr_main.h
)
add_library(rdpdr SHARED ${RDPDR_SRCS})
add_library(rdpdr ${RDPDR_SRCS})
set_target_properties(rdpdr PROPERTIES PREFIX "")
target_link_libraries(rdpdr freerdp-utils)

View File

@ -25,7 +25,7 @@ set(DISK_SRCS
include_directories(..)
add_library(disk SHARED ${DISK_SRCS})
add_library(disk ${DISK_SRCS})
set_target_properties(disk PROPERTIES PREFIX "")
target_link_libraries(disk freerdp-utils)

View File

@ -33,7 +33,7 @@ endif()
include_directories(..)
add_library(printer SHARED ${PRINTER_SRCS})
add_library(printer ${PRINTER_SRCS})
set_target_properties(printer PROPERTIES PREFIX "")
target_link_libraries(printer freerdp-utils)

View File

@ -22,7 +22,7 @@ set(RDPSND_SRCS
rdpsnd_main.h
)
add_library(rdpsnd SHARED ${RDPSND_SRCS})
add_library(rdpsnd ${RDPSND_SRCS})
set_target_properties(rdpsnd PROPERTIES PREFIX "")
target_link_libraries(rdpsnd freerdp-utils)

View File

@ -24,7 +24,7 @@ set(RDPSND_ALSA_SRCS
include_directories(..)
include_directories(${ALSA_INCLUDE_DIRS})
add_library(rdpsnd_alsa SHARED ${RDPSND_ALSA_SRCS})
add_library(rdpsnd_alsa ${RDPSND_ALSA_SRCS})
set_target_properties(rdpsnd_alsa PROPERTIES PREFIX "")
target_link_libraries(rdpsnd_alsa freerdp-utils)

View File

@ -24,7 +24,7 @@ set(RDPSND_PULSE_SRCS
include_directories(..)
include_directories(${PULSE_INCLUDE_DIRS})
add_library(rdpsnd_pulse SHARED ${RDPSND_PULSE_SRCS})
add_library(rdpsnd_pulse ${RDPSND_PULSE_SRCS})
set_target_properties(rdpsnd_pulse PROPERTIES PREFIX "")
target_link_libraries(rdpsnd_pulse freerdp-utils)

View File

@ -26,7 +26,7 @@ set(FREERDP_CACHE_SRCS
glyph.c
cache.c)
add_library(freerdp-cache SHARED ${FREERDP_CACHE_SRCS})
add_library(freerdp-cache ${FREERDP_CACHE_SRCS})
set_target_properties(freerdp-cache PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")

View File

@ -21,7 +21,7 @@ set(FREERDP_CHANMAN_SRCS
libchanman.c
libchanman.h)
add_library(freerdp-chanman SHARED ${FREERDP_CHANMAN_SRCS})
add_library(freerdp-chanman ${FREERDP_CHANMAN_SRCS})
set_target_properties(freerdp-chanman PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")
target_link_libraries(freerdp-chanman freerdp-utils)

View File

@ -92,7 +92,7 @@ set(LIBFREERDP_CORE_SRCS
peer.h
)
add_library(freerdp-core SHARED ${LIBFREERDP_CORE_SRCS})
add_library(freerdp-core ${LIBFREERDP_CORE_SRCS})
set_target_properties(freerdp-core PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")

View File

@ -34,7 +34,7 @@ set(FREERDP_GDI_SRCS
shape.c
gdi.c)
add_library(freerdp-gdi SHARED ${FREERDP_GDI_SRCS})
add_library(freerdp-gdi ${FREERDP_GDI_SRCS})
target_link_libraries(freerdp-gdi freerdp-cache)
target_link_libraries(freerdp-gdi freerdp-rfx)

View File

@ -27,7 +27,7 @@ set(FREERDP_KBD_SRCS
libkbd.c
libkbd.h)
add_library(freerdp-kbd SHARED ${FREERDP_KBD_SRCS})
add_library(freerdp-kbd ${FREERDP_KBD_SRCS})
find_suggested_package(XKBFile)
if(XKBFILE_FOUND)

View File

@ -23,7 +23,7 @@ set(FREERDP_RAIL_SRCS
icon.c
rail.c)
add_library(freerdp-rail SHARED ${FREERDP_RAIL_SRCS})
add_library(freerdp-rail ${FREERDP_RAIL_SRCS})
set_target_properties(freerdp-rail PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")

View File

@ -39,7 +39,7 @@ set(LIBFREERDP_RFX_SRCS
librfx.c
)
add_library(freerdp-rfx SHARED ${LIBFREERDP_RFX_SRCS})
add_library(freerdp-rfx ${LIBFREERDP_RFX_SRCS})
set_target_properties(freerdp-rfx PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")

View File

@ -24,7 +24,7 @@ set(LIBFREERDP_RFX_SSE2_SRCS
include_directories(..)
add_library(freerdp-rfx-sse2 STATIC ${LIBFREERDP_RFX_SSE2_SRCS})
add_library(freerdp-rfx-sse2 ${LIBFREERDP_RFX_SSE2_SRCS})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set_target_properties(freerdp-rfx-sse2 PROPERTIES COMPILE_FLAGS "-fPIC")

View File

@ -46,7 +46,7 @@ set(FREERDP_UTILS_SRCS
add_definitions(-DPLUGIN_PATH="${FREERDP_PLUGIN_PATH}")
add_library(freerdp-utils SHARED ${FREERDP_UTILS_SRCS})
add_library(freerdp-utils ${FREERDP_UTILS_SRCS})
set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib")