From 10860783efa388c3f2573e108b9a14ad91af3af7 Mon Sep 17 00:00:00 2001
From: Roman Donchenko <roman.donchenko@itseez.com>
Date: Thu, 22 Aug 2013 18:25:38 +0400
Subject: [PATCH] Added warnings-as-errors support for MSVC.

---
 cmake/OpenCVCompilerOptions.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
index 4ba6469979..8ead1a1703 100644
--- a/cmake/OpenCVCompilerOptions.cmake
+++ b/cmake/OpenCVCompilerOptions.cmake
@@ -239,6 +239,10 @@ if(MSVC)
       set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
     endif()
   endif()
+
+  if(OPENCV_WARNINGS_ARE_ERRORS)
+    set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
+  endif()
 endif()
 
 # Extra link libs if the user selects building static libs:
-- 
2.18.0