--- a/Applications/Cxx/CMakeLists.txt
+++ b/Applications/Cxx/CMakeLists.txt
@@ -6,7 +6,7 @@
 # gdcmanon
 
 
-if(WIN32 AND NOT CYGWIN)
+if(WIN32 AND NOT CYGWIN AND NOT MINGW)
   include_directories(
     "${GDCM_SOURCE_DIR}/Utilities/getopt"
   )
@@ -183,7 +183,7 @@
   if(GDCM_EXECUTABLE_PROPERTIES)
     set_target_properties(${exename} PROPERTIES ${GDCM_EXECUTABLE_PROPERTIES})
   endif()
-  if(WIN32 AND NOT CYGWIN)
+  if(WIN32 AND NOT CYGWIN AND NOT MINGW)
     target_link_libraries(${exename} gdcmgetopt)
   endif()
   if(NOT GDCM_INSTALL_NO_RUNTIME)
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -71,7 +71,7 @@
 # Do getopt
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/getopt)
   APPEND_COPYRIGHT(${CMAKE_CURRENT_SOURCE_DIR}/getopt/COPYING)
-  if(WIN32 AND NOT CYGWIN)
+  if(WIN32 AND NOT CYGWIN AND NOT MINGW)
     set(GETOPT_NAMESPACE "GDCMGETOPT")
     set(GETOPT_INSTALL_NO_LIBRARIES ${GDCM_INSTALL_NO_LIBRARIES})
     set(GETOPT_INSTALL_BIN_DIR      ${GDCM_INSTALL_BIN_DIR})
