From a31bcba8911c1469fae3d15ffa23c5e5c03e9122 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 28 Sep 2017 13:58:28 +0200
Subject: [PATCH] [CMake] 3.9 + DE works in VS but nowhere else.

---
 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f7df5ebaca..fd3225f0da9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,8 +68,10 @@ if(OGS_BUILD_GUI)
     add_definitions(-DOGS_BUILD_GUI)
     # TODO: Remove when this is fixed in CMake, maybe in 3.10
     # https://gitlab.kitware.com/cmake/cmake/issues/17205
-    if(${CMAKE_VERSION} VERSION_GREATER 3.8.2)
-        message(FATAL_ERROR "OGS_BUILD_GUI is not supported with CMake 3.9.x. Please downgrade CMake to 3.8.x!")
+    if(${CMAKE_VERSION} VERSION_GREATER 3.8.2 AND
+        NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+        message(FATAL_ERROR "OGS_BUILD_GUI is not supported with CMake 3.9.x! "
+            "Please downgrade CMake to 3.8.x!")
     endif()
 endif()
 option(OGS_BUILD_UTILS "Should the utilities programms be built?" OFF)
-- 
GitLab