Fix missing gflags shlwapi dependency on MinGW.
- Reported by Simeon (s1m3mu3@gmail.com) on Ceres mailing list.
Change-Id: If23491128fb6320d9b643eb3d5db7d9e67ffcf0b
diff --git a/cmake/FindGflags.cmake b/cmake/FindGflags.cmake
index 99d461e..959b4e3 100644
--- a/cmake/FindGflags.cmake
+++ b/cmake/FindGflags.cmake
@@ -222,14 +222,15 @@
# detect threads, we assume that gflags requires it.
FIND_PACKAGE(Threads QUIET)
SET(GFLAGS_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-# On Windows, the Shlwapi library is used by gflags if available.
-IF (MSVC)
+# On Windows (including MinGW), the Shlwapi library is used by gflags if
+# available.
+IF (WIN32)
INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("shlwapi.h" HAVE_SHLWAPI)
IF (HAVE_SHLWAPI)
LIST(APPEND GFLAGS_LINK_LIBRARIES shlwapi.lib)
ENDIF(HAVE_SHLWAPI)
-ENDIF (MSVC)
+ENDIF (WIN32)
# Mark internally as found, then verify. GFLAGS_REPORT_NOT_FOUND() unsets
# if called.