diff -Naur soci-4.0.0-orig/cmake/modules/FindMySQL.cmake soci-4.0.0/cmake/modules/FindMySQL.cmake
--- soci-4.0.0-orig/cmake/modules/FindMySQL.cmake	2019-11-09 22:08:01.000000000 +0300
+++ soci-4.0.0/cmake/modules/FindMySQL.cmake	2020-04-21 15:06:54.805778400 +0300
@@ -16,7 +16,7 @@
 
 include(CheckCXXSourceCompiles)
 
-if(WIN32)
+if(MSVC)
    find_path(MYSQL_INCLUDE_DIR mysql.h
       PATHS
       $ENV{MYSQL_INCLUDE_DIR}
@@ -25,7 +25,7 @@
       $ENV{SystemDrive}/MySQL/*/include
       $ENV{ProgramW6432}/MySQL/*/include
    )
-else(WIN32)
+else(MSVC)
    find_path(MYSQL_INCLUDE_DIR mysql.h
       PATHS
       $ENV{MYSQL_INCLUDE_DIR}
@@ -35,9 +35,9 @@
       PATH_SUFFIXES
       mysql
    )
-endif(WIN32)
+endif(MSVC)
 
-if(WIN32)
+if(MSVC)
    if (${CMAKE_BUILD_TYPE})
     string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
    endif()
@@ -71,7 +71,7 @@
       PATHS
       ${MYSQL_LIB_PATHS}
    )
-else(WIN32)
+else(MSVC)
 #   find_library(MYSQL_LIBRARIES NAMES mysqlclient
    set(MYSQL_LIB_PATHS
       $ENV{MYSQL_DIR}/libmysql_r/.libs
@@ -91,7 +91,7 @@
       PATHS
       ${MYSQL_LIB_PATHS}
    )
-endif(WIN32)
+endif(MSVC)
 
 find_library(MYSQL_EMBEDDED_LIBRARIES NAMES mysqld
    PATHS
diff -Naur soci-4.0.0-orig/cmake/SociBackend.cmake soci-4.0.0/cmake/SociBackend.cmake
--- soci-4.0.0-orig/cmake/SociBackend.cmake	2019-11-09 22:08:01.000000000 +0300
+++ soci-4.0.0/cmake/SociBackend.cmake	2020-04-21 15:03:10.229480900 +0300
@@ -229,7 +229,7 @@
          )
       endif()
 
-      install(EXPORT SOCI NAMESPACE SOCI:: DESTINATION cmake)
+      install(EXPORT SOCI NAMESPACE SOCI:: DESTINATION lib/cmake/soci)
 
     else()
         colormsg(HIRED "${NAME}" RED "backend disabled, since")
diff -Naur soci-4.0.0-orig/CMakeLists.txt soci-4.0.0/CMakeLists.txt
--- soci-4.0.0-orig/CMakeLists.txt	2019-11-09 22:08:01.000000000 +0300
+++ soci-4.0.0/CMakeLists.txt	2020-04-21 14:59:51.383414700 +0300
@@ -84,7 +84,7 @@
   message(FATAL_ERROR "No thread library found")
 endif()
 
-if(NOT MSVC)
+if(NOT WIN32)
   set(DL_FIND_QUIETLY TRUE)
   find_package(DL)
   if(DL_FOUND)
@@ -134,7 +134,7 @@
 ###############################################################################
 
 if(NOT DEFINED SOCI_LIBDIR)
-  if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
+  if(APPLE OR WIN32 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
     set(SOCI_LIBDIR "lib")
   else()
     set(SOCI_LIBDIR "lib64")
diff -Naur soci-4.0.0-orig/src/core/CMakeLists.txt soci-4.0.0/src/core/CMakeLists.txt
--- soci-4.0.0-orig/src/core/CMakeLists.txt	2019-11-09 22:08:01.000000000 +0300
+++ soci-4.0.0/src/core/CMakeLists.txt	2020-04-21 14:59:51.383414700 +0300
@@ -124,7 +124,7 @@
     ARCHIVE DESTINATION ${LIBDIR})
 endif()
 
-install(EXPORT SOCI NAMESPACE SOCI:: DESTINATION cmake)
+install(EXPORT SOCI NAMESPACE SOCI:: DESTINATION share/cmake/soci)
 
 #
 # Core configuration summary
