diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-06-01 14:52:27 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-06-01 14:52:27 +0200 |
commit | 1880ef54d2c97c60ce9a29676f0214814c20d57b (patch) | |
tree | 5cf98bcf364aa34b789bee73f6a0cca2f5758c61 /src/threads/CMakeLists.txt | |
parent | 94ca5ed3dfb18307d82117584dff789333366c61 (diff) | |
download | libssh-1880ef54d2c97c60ce9a29676f0214814c20d57b.tar.gz libssh-1880ef54d2c97c60ce9a29676f0214814c20d57b.tar.xz libssh-1880ef54d2c97c60ce9a29676f0214814c20d57b.zip |
cmake: Fix static .lib overwriting on Windows.
Diffstat (limited to 'src/threads/CMakeLists.txt')
-rw-r--r-- | src/threads/CMakeLists.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt index 0373fee3..b95525e4 100644 --- a/src/threads/CMakeLists.txt +++ b/src/threads/CMakeLists.txt @@ -86,6 +86,12 @@ install( if (WITH_STATIC_LIB) add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS}) + if (MSVC) + set(OUTPUT_SUFFIX static) + else (MSVC) + set(OUTPUT_SUFFIX ) + endif (MSVC) + set_target_properties( ${LIBSSH_THREADS_STATIC_LIBRARY} PROPERTIES @@ -93,15 +99,26 @@ if (WITH_STATIC_LIB) ${LIBRARY_VERSION} SOVERSION ${LIBRARY_SOVERSION} - COMPILE_FLAGS - "-DLIBSSH_STATIC" + OUTPUT_NAME + ssh_threads + ARCHIVE_OUTPUT_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX} + ) + + if (WIN32) + set_target_properties( + ${LIBSSH_THREADS_STATIC_LIBRARY} + PROPERTIES + COMPILE_FLAGS + "-DLIBSSH_STATIC" ) + endif (WIN32) install( TARGETS ${LIBSSH_THREADS_STATIC_LIBRARY} DESTINATION - ${LIB_INSTALL_DIR} + ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX} COMPONENT libraries ) |