From 25e43a469aff1475b91bd1d038377e2714cda50d Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Thu, 25 Feb 2010 16:20:19 +0100
Subject: [PATCH] BUG: OTB_USE_EXTERNAL_FLTK option will not appear, even if
 FLTK is not found on the system. It seems that CMAKE_DEPENDENT_OPTION is not
 behaving like expected.

---
 CMakeLists.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f332da174..dc284c53ed 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -289,8 +289,13 @@ IF(OTB_USE_VISU_GUI)
         #OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF)
         
         FIND_PACKAGE(FLTK)
-        CMAKE_DEPENDENT_OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." ON
-                         "FLTK_FOUND" OFF)
+
+	# If an external fltk is found, do not provide the internal fltk choice
+	IF(NOT FLTK_FOUND)
+          OPTION(OTB_USE_EXTERNAL_FLTK "Use an outside build of FLTK." OFF)
+	ELSE(NOT FLTK_FOUND)
+	  SET(OTB_USE_EXTERNAL_FLTK ON)
+	ENDIF(NOT FLTK_FOUND)
                          
 #        IF(FLTK_FOUND)
 #           SET(OTB_USE_EXTERNAL_FLTK ON)
-- 
GitLab