Blame SOURCES/0001-Only-require-glib-2.40-when-tests-are-build-without-.patch

714cf1
From 75a845abfe4823837e3f07274911dc275150f5a4 Mon Sep 17 00:00:00 2001
714cf1
From: seebk <mail@sebastiankraft.net>
714cf1
Date: Sat, 21 Nov 2015 09:48:41 +0000
714cf1
Subject: [PATCH 001/113] Only require glib 2.40 when tests are build, without
714cf1
 tests glib 2.26 is sufficient
714cf1
714cf1
---
714cf1
 CMakeLists.txt | 14 ++++++++++----
714cf1
 1 file changed, 10 insertions(+), 4 deletions(-)
714cf1
714cf1
diff --git a/CMakeLists.txt b/CMakeLists.txt
714cf1
index ceac8fc..21f082b 100644
714cf1
--- a/CMakeLists.txt
714cf1
+++ b/CMakeLists.txt
714cf1
@@ -85,10 +85,16 @@ IF(WIN32)
714cf1
   ENDIF()
714cf1
 ENDIF()
714cf1
 
714cf1
-# find dependencies
714cf1
-# NOTE: must be one of the macros listed in https://developer.gnome.org/glib/stable/glib-Version-Information.html
714cf1
-SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_40")
714cf1
-FIND_PACKAGE(GLIB2 REQUIRED 2.40)
714cf1
+
714cf1
+IF (BUILD_TESTS)
714cf1
+  # automatic tests need at least glib version 2.40
714cf1
+  # NOTE: must be one of the macros listed in https://developer.gnome.org/glib/stable/glib-Version-Information.html
714cf1
+  SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_40")
714cf1
+  FIND_PACKAGE(GLIB2 REQUIRED)
714cf1
+ELSE()
714cf1
+  SET(LENSFUN_GLIB_REQUIREMENT_MACRO "GLIB_VERSION_2_26")
714cf1
+  FIND_PACKAGE(GLIB2 REQUIRED)
714cf1
+ENDIF()
714cf1
 
714cf1
 INCLUDE_DIRECTORIES(SYSTEM ${GLIB2_INCLUDE_DIRS})
714cf1
 
714cf1
-- 
714cf1
2.7.4
714cf1