From 7eae0ba808876e11f7d8c632ab33ca71a4fe2371 Mon Sep 17 00:00:00 2001
From: Manuel Grizonnet <manuel.grizonnet@gmail.com>
Date: Thu, 23 Sep 2010 11:31:02 +0200
Subject: [PATCH] COMP:test Boost version only if an external Boost was found

---
 CMakeLists.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02d7152daf..b3af063c9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -509,11 +509,15 @@ ENDIF(OTB_USE_PQXX)
 # Boost Library
 #-------------------------------
 FIND_PACKAGE(Boost)
-IF(Boost_FOUND AND ( NOT (${Boost_MINOR_VERSION} EQUAL 40)))
-  OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." ON)
-ELSE(Boost_FOUND AND ( NOT (${Boost_MINOR_VERSION} EQUAL 40)))
+IF(Boost_FOUND)
+  IF (NOT (${Boost_MINOR_VERSION} EQUAL 40))
+    OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." ON)
+  ELSE (NOT (${Boost_MINOR_VERSION} EQUAL 40))
+    OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF)
+  ENDIF (NOT (${Boost_MINOR_VERSION} EQUAL 40))
+ELSE(Boost_FOUND)
   OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF)
-ENDIF(Boost_FOUND AND ( NOT (${Boost_MINOR_VERSION} EQUAL 40)))
+ENDIF(Boost_FOUND)
 # Option for internal/external BOOST
 MARK_AS_ADVANCED(OTB_USE_EXTERNAL_BOOST)
 
-- 
GitLab