From 23e0b17fe5b82c84d8d1bd5b6f50f5c78307d4e9 Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Date: Mon, 12 Apr 2021 18:14:39 +0300
Subject: [PATCH 2/2] Fix Cygwin/MSYS target directories

CYGWIN doesn't define WIN32 since 2.8.4.
---
 CMakeLists.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2b258564..9df65cf0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2600,7 +2600,7 @@ if(NOT BUILD_SHARED_LIBS)
     unset(LIBRARY_NAME)
 endif(NOT BUILD_SHARED_LIBS)
 
-if(WIN32)
+if(WIN32 OR CYGWIN)
     if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
         #
         # Install 64-bit code built with MSVC in the x64 subdirectories,
@@ -2628,18 +2628,18 @@ if(WIN32)
                 RUNTIME DESTINATION bin
                 LIBRARY DESTINATION lib
                 ARCHIVE DESTINATION lib)
-        if(NOT MINGW)
+        if(MSVC)
             install(FILES $<TARGET_FILE_DIR:${LIBRARY_NAME_STATIC}>/${LIBRARY_NAME_STATIC}.pdb
                     DESTINATION bin OPTIONAL)
             if(BUILD_SHARED_LIBS)
                 install(FILES $<TARGET_PDB_FILE:${LIBRARY_NAME}>
                         DESTINATION bin OPTIONAL)
             endif(BUILD_SHARED_LIBS)
-        endif(NOT MINGW)
+        endif(MSVC)
     endif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
-else(WIN32)
+else(WIN32 OR CYGWIN)
     install(TARGETS ${LIBRARY_NAME} ${LIBRARY_NAME_STATIC} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
-endif(WIN32)
+endif(WIN32 OR CYGWIN)
 
 install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcap/ DESTINATION include/pcap)
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include)
-- 
2.31.0.windows.1

