  
  #libSSH2
  option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON)
-@@ -1144,7 +1166,9 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
- 
- endfunction()
- 
--if(WIN32 AND NOT CYGWIN)
-+if(MSVC)
-+  set(CURL_INSTALL_CMAKE_DIR share/curl)
-+elseif(WIN32 AND NOT CYGWIN)
-   set(CURL_INSTALL_CMAKE_DIR CMake)
+@@ -1259,7 +1267,21 @@ if(BUILD_SHARED_LIBS)
  else()
-   set(CURL_INSTALL_CMAKE_DIR lib/cmake/curl)
+   set(ENABLE_SHARED         "no")
+   set(ENABLE_STATIC         "yes")
++  add_definitions(-DNGHTTP2_STATICLIB)
++  set(CompilerFlags
++    CMAKE_CXX_FLAGS
++    CMAKE_CXX_FLAGS_DEBUG
++    CMAKE_CXX_FLAGS_RELEASE
++    CMAKE_C_FLAGS
++    CMAKE_C_FLAGS_DEBUG
++    CMAKE_C_FLAGS_RELEASE
++  )
++  foreach(CompilerFlag ${CompilerFlags})
++    string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
++  endforeach()
+ endif()
++
++
+ set(exec_prefix             "\${prefix}")
+ set(includedir              "\${prefix}/include")
+ set(LDFLAGS                 "${CMAKE_SHARED_LINKER_FLAGS}")
 diff --git a/src/curl.rc b/src/curl.rc
 index d47f50635..239918eee 100644
 --- a/src/curl.rc

 
 if(LIBSSH2_INCLUDE_DIR)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6dbb73f1..c0e4a5f6e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -323,7 +323,7 @@ if(CMAKE_USE_WINSSL)

 endif()
 if(CURL_WINDOWS_SSPI)
   set(USE_WINDOWS_SSPI ON)
@@ -530,16 +530,24 @@ if(CURL_ZLIB)
 endif()
 
 option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
