From eb897c2389cf76f943c5aa2b8635fede123f8dcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Thu, 15 Jan 2015 14:22:09 +0100
Subject: [PATCH] [CMake] Fix regex to find directories "test" with all sub
 dirs.

The regex wrongly matched directories ending in "test",
cf. FS#1553.
---
 cmake/scripts/FindFiles.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/scripts/FindFiles.cmake b/cmake/scripts/FindFiles.cmake
index d474989cc..df7440ed8 100644
--- a/cmake/scripts/FindFiles.cmake
+++ b/cmake/scripts/FindFiles.cmake
@@ -3,7 +3,7 @@ cmake_policy(SET CMP0009 NEW)
 file(GLOB_RECURSE makefiles RELATIVE ${RELPATH} "CMakeLists.txt")
 foreach(_file ${makefiles})
   # path contains "/test" or is directly "test"
-  string(REGEX MATCH "(.*/)*test" _testdir ${_file})
+  string(REGEX MATCH "^(.*/)*test" _testdir ${_file})
   # path end with "/test" and not "/testFoo" or "/test/foo"
   string(REGEX MATCH "(.*/)*test/CMakeLists.txt$" _testdirensured ${_file})
   if(_testdir AND _testdirensured)
-- 
GitLab