From a63e9bb765fdc90df3a23482d144c781dd8fa2d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mariusz=20Pluci=C5=84ski?= <mplucinski@mplucinski.com>
Date: Sun, 21 Feb 2016 00:05:52 +0100
Subject: Tests: do not build ExternalProjectLocal/TutorialStep5 when path is
 too long

---
 Tests/ExternalProjectLocal/CMakeLists.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index e1a67db..619c674 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -35,6 +35,17 @@ if(NOT DEFINED can_build_tutorial_step5)
     endif()
   endif()
 
+  # The same as above may happen using Visual Studio 14
+  # on Windows 8.1 - when any of the temporary files created
+  # during build has full path longer than 255 characters, the
+  # build may fail
+  if(CMAKE_SYSTEM MATCHES "Windows-6.*")
+    string(LENGTH "${binary_base}/TutorialStep5-Local" n)
+    if(n GREATER 100)
+      set(can_build_tutorial_step5 0)
+    endif()
+  endif()
+  
   # The ExternalProject builds of Tutorial Step5 cannot be built
   # correctly 2nd and later times in an in-source build...
   # (because the CMakeCache.txt from the real in-source build of
-- 
2.7.1

