From ed8d66fb03ff296ca684359b9a7f65aeafd7e7e0 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 4 Sep 2022 10:57:08 +0200
Subject: [PATCH 3/3] set static lib extension on windows

---
 CMakeLists.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 04cb3303a..9841f3f76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -316,6 +316,12 @@ if (protobuf_BUILD_PROTOC_BINARIES)
   endif (NOT DEFINED protobuf_PROTOC_EXE)
 endif (protobuf_BUILD_PROTOC_BINARIES)
 
+if (MSVC AND NOT protobuf_BUILD_SHARED_LIBS)
+  set_target_properties(libprotoc PROPERTIES SUFFIX "-static.lib")
+  set_target_properties(libprotobuf PROPERTIES SUFFIX "-static.lib")
+  set_target_properties(libprotobuf-lite PROPERTIES SUFFIX "-static.lib")
+endif (MSVC AND NOT protobuf_BUILD_SHARED_LIBS)
+
 # Ensure we have a protoc executable if we need one
 if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES)
   if (NOT DEFINED protobuf_PROTOC_EXE)
-- 
2.37.0.windows.1

