aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-03-25 15:01:33 +0000
committerAndreas Schneider <mail@cynapses.org>2009-03-25 15:01:33 +0000
commitfae68cac8a5ffd5a52257f2b62110d91a95d62ab (patch)
tree0eaa1d6d0099fb9c1527f6efb7b9d661237891c2 /libssh
parentcf89b6eb48ea1d644b68cef53c2d7be46aaaa62f (diff)
downloadlibssh-fae68cac8a5ffd5a52257f2b62110d91a95d62ab.tar.gz
libssh-fae68cac8a5ffd5a52257f2b62110d91a95d62ab.tar.xz
libssh-fae68cac8a5ffd5a52257f2b62110d91a95d62ab.zip
Add an option to build a static library.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@285 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/CMakeLists.txt52
1 files changed, 44 insertions, 8 deletions
diff --git a/libssh/CMakeLists.txt b/libssh/CMakeLists.txt
index 91ee3ccb..9c78d0d7 100644
--- a/libssh/CMakeLists.txt
+++ b/libssh/CMakeLists.txt
@@ -12,13 +12,19 @@ set(LIBSSH_PRIVATE_INCLUDE_DIRS
${ZLIB_INCLUDE_DIRS}
)
-set(LIBSSH_LIBRARY
- ssh
- CACHE INTERNAL "libssh library"
+set(LIBSSH_SHARED_LIBRARY
+ ssh_shared
+ CACHE INTERNAL "libssh shared library"
)
+if (WITH_STATIC_LIB)
+ set(LIBSSH_STATIC_LIBRARY
+ ssh_static
+ CACHE INTERNAL "libssh static library"
+ )
+endif (WITH_STATIC_LIB)
+
set(LIBSSH_LINK_LIBRARIES
- ${LIBSSH_LIBRARY}
${ZLIB_LIBRARIES}
)
@@ -34,6 +40,7 @@ if (CRYPTO_LIBRARY)
${LIBSSH_PRIVATE_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
)
+
set(LIBSSH_LINK_LIBRARIES
${LIBSSH_LINK_LIBRARIES}
${CRYPTO_LIBRARY}
@@ -45,6 +52,7 @@ if (GCRYPT_LIBRARY)
${LIBSSH_PRIVATE_INCLUDE_DIRS}
${GCRYPT_INCLUDE_DIRS}
)
+
set(LIBSSH_LINK_LIBRARIES
${LIBSSH_LINK_LIBRARIES}
${GCRYPT_LIBRARY}
@@ -95,25 +103,53 @@ include_directories(
${LIBSSH_PRIVATE_INCLUDE_DIRS}
)
-add_library(${LIBSSH_LIBRARY} SHARED ${libssh_SRCS})
+add_library(${LIBSSH_SHARED_LIBRARY} SHARED ${libssh_SRCS})
-target_link_libraries(${LIBSSH_LINK_LIBRARIES})
+target_link_libraries(${LIBSSH_SHARED_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
set_target_properties(
- ${LIBSSH_LIBRARY}
+ ${LIBSSH_SHARED_LIBRARY}
PROPERTIES
VERSION
${LIBRARY_VERSION}
SOVERSION
${LIBRARY_SOVERSION}
+ OUTPUT_NAME
+ ssh
)
install(
TARGETS
- ${LIBSSH_LIBRARY}
+ ${LIBSSH_SHARED_LIBRARY}
DESTINATION
${LIB_INSTALL_DIR}
COMPONENT
libraries
)
+if (WITH_STATIC_LIB)
+ add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
+
+ target_link_libraries(${LIBSSH_STATIC_LIBRARY} ${LIBSSH_LINK_LIBRARIES})
+
+ set_target_properties(
+ ${LIBSSH_STATIC_LIBRARY}
+ PROPERTIES
+ VERSION
+ ${LIBRARY_VERSION}
+ SOVERSION
+ ${LIBRARY_SOVERSION}
+ OUTPUT_NAME
+ ssh
+ )
+
+ install(
+ TARGETS
+ ${LIBSSH_STATIC_LIBRARY}
+ DESTINATION
+ ${LIB_INSTALL_DIR}
+ COMPONENT
+ libraries
+ )
+endif (WITH_STATIC_LIB)
+