From 8dc831088ee3878e69a001004357d0f106e34fb8 Mon Sep 17 00:00:00 2001 From: Ahmed Samy Date: Wed, 12 Feb 2014 22:31:18 +0200 Subject: [PATCH] CMake: Optional static/shared linkage for the framework lib --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd4a1205..e8e2e511 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,13 @@ endif() add_definitions(-D"VERSION=\\"${VERSION}\\"") -# we want framework to be a static library for faster compilation/linking -add_library(${LIB_NAME} ${framework_SOURCES}) +# we want framework to be a library for faster compilation/linking +if(USE_STATIC_LIBS) + add_library(${LIB_NAME} ${framework_SOURCES}) +else() + add_library(${LIB_NAME} SHARED ${framework_SOURCES}) + message(STATUS "Linking to shared ${LIB_NAME}, make sure you copy the DLL/SO/dylib with the executable!") +endif() target_link_libraries(${LIB_NAME} ${framework_LIBRARIES}) # add client executable