From 2b2d934c1a31a496d9146c806d1ae8261a82c4b4 Mon Sep 17 00:00:00 2001
From: Martin Killenberg <martin.killenberg@desy.de>
Date: Thu, 21 Jul 2016 17:41:43 +0200
Subject: [PATCH] fixed generation of @PROJECT_NAME@_found for CMake < 2.8.11

---
 cmake/FindPROJECT_NAME.cmake.in.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmake/FindPROJECT_NAME.cmake.in.in b/cmake/FindPROJECT_NAME.cmake.in.in
index f1a3a4cd..2190bb24 100644
--- a/cmake/FindPROJECT_NAME.cmake.in.in
+++ b/cmake/FindPROJECT_NAME.cmake.in.in
@@ -52,9 +52,10 @@ include(FindPackageHandleStandardArgs)
 # The FOUND_VAR option in FIND_PACKAGE_HANDLE_STANDARD_ARGS was introduced in cmake-2.8.11, but Ubuntu 12.04 has cmake-2.8.7 only.
 # Thus we use a work around here for older cmake versions.
 if("${CMAKE_VERSION}" VERSION_LESS 2.8.11)
+  # The old version always provides a variable with upper case project name, so we just copy that
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(@PROJECT_NAME@ REQUIRED_VARS @PROJECT_NAME@_PREFIX VERSION_VAR @PROJECT_NAME@_VERSION)
   STRING(TOUPPER "@PROJECT_NAME@" PROJECT_NAME_UPPERCASE)
-  set(@PROJECT_NAME@_VERSION ${PROJECT_NAME_UPPERCASE})
+  set(@PROJECT_NAME@_FOUND ${${PROJECT_NAME_UPPERCASE}_FOUND})
 else()
   FIND_PACKAGE_HANDLE_STANDARD_ARGS(@PROJECT_NAME@ REQUIRED_VARS @PROJECT_NAME@_PREFIX VERSION_VAR @PROJECT_NAME@_VERSION FOUND_VAR @PROJECT_NAME@_FOUND)
 endif()
-- 
GitLab