From 159bc14ff3b9adb13d00d4d32aa57868a19af103 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Fri, 20 Feb 2015 15:46:30 +0100
Subject: [PATCH] COMP: add a cmakedefine in otbConfigure.h for all optional
 thrid parties

---
 Modules/Core/Common/CMakeLists.txt        | 9 ++++++++-
 Modules/Core/Common/src/otbConfigure.h.in | 1 +
 Modules/ThirdParty/Curl/src/otb_curl.h.in | 1 -
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Modules/Core/Common/CMakeLists.txt b/Modules/Core/Common/CMakeLists.txt
index 397c92c961..e180e1e3b7 100644
--- a/Modules/Core/Common/CMakeLists.txt
+++ b/Modules/Core/Common/CMakeLists.txt
@@ -1,6 +1,13 @@
 project(OTBCommon)
 
-configure_file(src/otbConfigure.h.in otbConfigure.h)
+configure_file(src/otbConfigure.h.in otbConfigure.h.in)
+file(APPEND ${OTBCommon_BINARY_DIR}/otbConfigure.h.in
+     "/* Optional third parties activation status */\n")
+foreach(_otb_module_activation_option IN LISTS OTB_MODULE_ACTIVATION_OPTION_LIST)
+  file(APPEND ${OTBCommon_BINARY_DIR}/otbConfigure.h.in
+       "#cmakedefine ${_otb_module_activation_option}\n")
+endforeach()
+configure_file(${OTBCommon_BINARY_DIR}/otbConfigure.h.in otbConfigure.h)
 
 set(OTBCommon_INCLUDE_DIRS
   ${OTBCommon_BINARY_DIR}
diff --git a/Modules/Core/Common/src/otbConfigure.h.in b/Modules/Core/Common/src/otbConfigure.h.in
index 9f56b04f1f..9b860c779a 100644
--- a/Modules/Core/Common/src/otbConfigure.h.in
+++ b/Modules/Core/Common/src/otbConfigure.h.in
@@ -19,3 +19,4 @@
 
 /* Show developper debug messages */
 #cmakedefine OTB_SHOW_ALL_MSG_DEBUG
+
diff --git a/Modules/ThirdParty/Curl/src/otb_curl.h.in b/Modules/ThirdParty/Curl/src/otb_curl.h.in
index 6d221b7a92..1617c168a1 100644
--- a/Modules/ThirdParty/Curl/src/otb_curl.h.in
+++ b/Modules/ThirdParty/Curl/src/otb_curl.h.in
@@ -17,7 +17,6 @@
 =========================================================================*/
 #ifndef __otb_curl_h
 
-#define OTB_USE_CURL 1
 #cmakedefine OTB_CURL_MULTI_AVAILABLE
 #include <curl/curl.h>
 
-- 
GitLab