From 9d3a7e4188269f80b73415a3038bcedf74b61e2f Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Wed, 5 Jan 2011 15:24:43 +0000 Subject: [PATCH] - Added CMake option USE_SHARED_POLARSSL_LIBRARY to allow for building of shared PolarSSL library --- library/CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f75629b2e..d30fa5dda 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -1,4 +1,6 @@ -add_library(polarssl STATIC +OPTION(USE_SHARED_POLARSSL_LIBRARY "Build PolarSSL as a shared library." OFF) + +set(src aes.c arc4.c base64.c @@ -27,6 +29,17 @@ add_library(polarssl STATIC xtea.c ) +if(NOT USE_SHARED_POLARSSL_LIBRARY) + +add_library(polarssl STATIC ${src}) + +else(NOT USE_SHARED_POLARSSL_LIBRARY) + +ADD_LIBRARY(polarssl SHARED ${src}) +SET_TARGET_PROPERTIES(polarssl PROPERTIES VERSION 0.14.1 SOVERSION 0) + +endif(NOT USE_SHARED_POLARSSL_LIBRARY) + INSTALL(TARGETS polarssl DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)