diff --git a/Modules/IO/ImageIO/src/otbImageIOFactory.cxx b/Modules/IO/ImageIO/src/otbImageIOFactory.cxx
index 85c215fa7f7676db9915b571839f4464c3598a65..4ab03b149a24507a8798877ce36f2430d1bffd09 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 9641b8e7f28c0c4b7e0639447265624c5ff19b84..e90da7bd936a874dce2a9cf506850718cf12b4d6 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