summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-03-29 17:16:19 +0300
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-03-29 17:19:52 +0300
commitdd4bf97836d07df0a4502b72f9024d0231156711 (patch)
tree5824ef394aacbf3f1781d369aa1dc90fbdc79ea0 /CMakeLists.txt
parentf8de9a4bd433791890572f7b9147e685653ddef9 (diff)
Use the same name for static and shared libraries
On all system except MSVC, the targets are different. Unix: libhiredis.so, libhiredis.a MinGW: libhiredis.dll+libhiredis.dll.a, libhiredis.a MSVC: hiredis.dll+hiredis.lib, hiredis_static.lib
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe6720b..899cd14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,11 @@ ADD_LIBRARY(hiredis_static STATIC ${hiredis_sources})
ADD_LIBRARY(hiredis::hiredis ALIAS hiredis)
ADD_LIBRARY(hiredis::hiredis_static ALIAS hiredis_static)
+IF(NOT MSVC)
+ SET_TARGET_PROPERTIES(hiredis_static
+ PROPERTIES OUTPUT_NAME hiredis)
+ENDIF()
+
SET_TARGET_PROPERTIES(hiredis
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
VERSION "${HIREDIS_SONAME}")
@@ -160,6 +165,10 @@ IF(ENABLE_SSL)
${hiredis_ssl_sources})
ADD_LIBRARY(hiredis_ssl_static STATIC
${hiredis_ssl_sources})
+ IF(NOT MSVC)
+ SET_TARGET_PROPERTIES(hiredis_ssl_static
+ PROPERTIES OUTPUT_NAME hiredis_ssl)
+ ENDIF()
IF (APPLE)
SET_PROPERTY(TARGET hiredis_ssl PROPERTY LINK_FLAGS "-Wl,-undefined -Wl,dynamic_lookup")