diff --git a/scripts/cmake/CompilerSetup.cmake b/scripts/cmake/CompilerSetup.cmake
index 9de02148abe5ea2d7a142e19cdbd655faa82c465..72a7e8c67b8d94b8387020efa49bb0410c8df67f 100644
--- a/scripts/cmake/CompilerSetup.cmake
+++ b/scripts/cmake/CompilerSetup.cmake
@@ -63,6 +63,7 @@ IF (WIN32)
 			-D_CRT_NONSTDC_NO_WARNINGS
 			-D_CRT_XNONSTDC_NO_WARNINGS
 			-D__restrict__=__restrict   # this fixes #5
+			-DNOMINMAX # This fixes compile errors with std::numeric_limits<T>::min() / max()
 		)
 		# Sets warning level 3 and ignores some warnings
 		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /wd4290 /wd4267")