From d4e1f907137628ba9bfbad94b1c8befeaada5ee4 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Thu, 19 Feb 2015 14:17:32 +0100
Subject: [PATCH] COMP: ImageIOFactory needs the definition of
 OTB_CURL_MULTI_AVAILABLE

---
 Modules/IO/ImageIO/src/otbImageIOFactory.cxx | 5 +++++
 Modules/ThirdParty/Curl/CMakeLists.txt       | 9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx
index 85c215fa7f..4ab03b149a 100644
--- a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx
+++ b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx
@@ -30,10 +30,15 @@
 #include "otbBSQImageIOFactory.h"
 #include "otbRADImageIOFactory.h"
 #include "otbMWImageIOFactory.h"
+
 #ifdef OTB_USE_JPEG2000
 #  include "otbJPEG2000ImageIOFactory.h"
 #endif
+
+#include "otb_curl.h"
+#ifdef OTB_CURL_MULTI_AVAILABLE
 #include "otbTileMapImageIOFactory.h"
+#endif
 
 namespace otb
 {
diff --git a/Modules/ThirdParty/Curl/CMakeLists.txt b/Modules/ThirdParty/Curl/CMakeLists.txt
index 9641b8e7f2..e90da7bd93 100644
--- a/Modules/ThirdParty/Curl/CMakeLists.txt
+++ b/Modules/ThirdParty/Curl/CMakeLists.txt
@@ -1,8 +1,5 @@
 project(OTBCurl)
 
-set(OTBCurl_SYSTEM_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
-set(OTBCurl_LIBRARIES "${CURL_LIBRARIES}")
-
 try_compile(OTB_CURL_MULTI_AVAILABLE
               ${CMAKE_CURRENT_BINARY_DIR}/CMake
               ${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestCurlMulti.cxx
@@ -11,6 +8,12 @@ try_compile(OTB_CURL_MULTI_AVAILABLE
 
 configure_file( src/otb_curl.h.in src/otb_curl.h )
 
+set(OTBCurl_SYSTEM_INCLUDE_DIRS ${CURL_INCLUDE_DIRS})
+set(OTBCurl_LIBRARIES "${CURL_LIBRARIES}")
+set(OTBCurl_INCLUDE_DIRS
+  ${OTBCurl_BINARY_DIR}
+  )
+
 otb_module_impl()
 
 install(FILES ${OTBCurl_BINARY_DIR}/src/otb_curl.h
-- 
GitLab