aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-07 19:48:27 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-06-07 19:48:27 +0400
commitb1cb2de69abe29bf984483479ad54947ffe675d3 (patch)
tree136b4f04e8f3011fd96edfe4742b1c81c43185a5 /lib
parent6cea7f1cd0a1b504f841a37ff40ce481b8332481 (diff)
downloadrspamd-b1cb2de69abe29bf984483479ad54947ffe675d3.tar.gz
rspamd-b1cb2de69abe29bf984483479ad54947ffe675d3.zip
Allow NO_SHARED build to use static archives for internal libraries.
Check for -fPIC/-fpic support.
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt39
1 files changed, 19 insertions, 20 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 4e30a70a8..b496d4dab 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -75,13 +75,14 @@ IF(GLIB_COMPAT)
TARGET_LINK_LIBRARIES(rspamd-util glibadditions)
ENDIF(GLIB_COMPAT)
-INSTALL(TARGETS rspamd-util
- LIBRARY DESTINATION ${LIBDIR}
- PUBLIC_HEADER DESTINATION include
- ARCHIVE DESTINATION ${LIBDIR})
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-util
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION include)
+ENDIF(NO_SHARED MATCHES "OFF")
# Rspamd client
-ADD_LIBRARY(rspamdclient ${LINK_TYPE} ${LIBRSPAMDCLIENTSRC})
+ADD_LIBRARY(rspamdclient SHARED ${LIBRSPAMDCLIENTSRC})
ADD_LIBRARY(rspamdclient_static STATIC ${LIBRSPAMDCLIENTSRC})
SET_TARGET_PROPERTIES(rspamdclient PROPERTIES PUBLIC_HEADER "client/librspamdclient.h")
@@ -139,10 +140,12 @@ ENDIF(SQLITE_LIBRARIES)
IF(OPENSSL_FOUND)
TARGET_LINK_LIBRARIES(rspamd-server ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
-INSTALL(TARGETS rspamd-server
- LIBRARY DESTINATION ${LIBDIR}
- PUBLIC_HEADER DESTINATION ${INCLUDEDIR}
- ARCHIVE DESTINATION ${LIBDIR})
+
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-server
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION ${INCLUDEDIR})
+ENDIF(NO_SHARED MATCHES "OFF")
# Librspamdmime
ADD_LIBRARY(rspamd-mime ${LINK_TYPE} ${LIBRSPAMDMIMESRC})
@@ -161,14 +164,15 @@ ELSE(GMIME24)
TARGET_LINK_LIBRARIES(rspamd-mime ${GMIME2_LIBRARIES})
ENDIF(GMIME24)
-INSTALL(TARGETS rspamd-mime
- LIBRARY DESTINATION ${LIBDIR}
- PUBLIC_HEADER DESTINATION ${INCLUDEDIR}
- ARCHIVE DESTINATION ${LIBDIR})
+IF(NO_SHARED MATCHES "OFF")
+ INSTALL(TARGETS rspamd-mime
+ LIBRARY DESTINATION ${LIBDIR}
+ PUBLIC_HEADER DESTINATION ${INCLUDEDIR})
+ENDIF(NO_SHARED MATCHES "OFF")
# Libkvstorageclient
-ADD_LIBRARY(kvstorageclient ${LINK_TYPE} ${LIBRKVSTORAGESRC})
+ADD_LIBRARY(kvstorageclient SHARED ${LIBRKVSTORAGESRC})
ADD_LIBRARY(kvstorageclient_static STATIC ${LIBRKVSTORAGESRC})
SET_TARGET_PROPERTIES(kvstorageclient PROPERTIES PUBLIC_HEADER "kvstorage/libkvstorageclient.h")
@@ -189,9 +193,4 @@ IF(GLIB_COMPAT)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/lgpl")
TARGET_LINK_LIBRARIES(kvstorageclient glibadditions)
ENDIF(GLIB_COMPAT)
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src")
-
-INSTALL(TARGETS rspamdclient rspamdclient_static LIBRARY PUBLIC_HEADER
- LIBRARY DESTINATION ${LIBDIR}
- PUBLIC_HEADER DESTINATION ${INCLUDEDIR}
- ARCHIVE DESTINATION ${LIBDIR})
+INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/src") \ No newline at end of file