cmake: Fix static .lib overwriting on Windows.

This commit is contained in:
Andreas Schneider
2011-06-01 14:52:27 +02:00
parent 94ca5ed3df
commit 1880ef54d2
2 changed files with 28 additions and 4 deletions

View File

@@ -190,6 +190,11 @@ install(
if (WITH_STATIC_LIB)
add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
if (MSVC)
set(OUTPUT_SUFFIX static)
else (MSVC)
set(OUTPUT_SUFFIX )
endif (MSVC)
set_target_properties(
${LIBSSH_STATIC_LIBRARY}
PROPERTIES
@@ -199,6 +204,8 @@ if (WITH_STATIC_LIB)
${LIBRARY_SOVERSION}
OUTPUT_NAME
ssh
ARCHIVE_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
)
if (WIN32)
@@ -214,7 +221,7 @@ if (WITH_STATIC_LIB)
TARGETS
${LIBSSH_STATIC_LIBRARY}
DESTINATION
${LIB_INSTALL_DIR}
${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
COMPONENT
libraries
)