Add link dependency on shlwapi.lib during build configuration instead of #pragma comment statement. Use this library also on MinGW.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa456ea..66bbd4c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,7 @@
       check_include_file_cxx ("${fname}.h" HAVE_${FNAME}_H)
     endif ()
   endforeach ()
-  # the following are used in #if not #ifdef
+  # the following are used in #if directives not #ifdef
   bool_to_int (HAVE_STDINT_H)
   bool_to_int (HAVE_SYS_TYPES_H)
   bool_to_int (HAVE_INTTYPES_H)
@@ -219,11 +219,17 @@
 set (LIB_TARGETS)
 if (BUILD_gflags_LIB)
   add_library (gflags ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
+  if (HAVE_SHLWAPI_H)
+    target_link_libraries (gflags shlwapi.lib)
+  endif ()
   list (APPEND LIB_TARGETS gflags)
 endif ()
 if (BUILD_gflags_nothreads_LIB)
   add_library (gflags_nothreads ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
   set_target_properties (gflags_nothreads PROPERTIES COMPILE_DEFINITIONS NO_THREADS)
+  if (HAVE_SHLWAPI_H)
+    target_link_libraries (gflags_nothreads shlwapi.lib)
+  endif ()
   list (APPEND LIB_TARGETS gflags_nothreads)
 endif ()