From 2d11d68833b0eef270dc45084b80a9c56a3afca3 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Tue, 14 Mar 2017 17:04:12 +0100
Subject: [PATCH] BUG: allow to disable remote modules already cloned

---
 CMake/OTBModuleEnablement.cmake | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/CMake/OTBModuleEnablement.cmake b/CMake/OTBModuleEnablement.cmake
index de17eef48b..6ef34dc657 100644
--- a/CMake/OTBModuleEnablement.cmake
+++ b/CMake/OTBModuleEnablement.cmake
@@ -41,6 +41,14 @@ foreach(f ${meta})
     set(${otb-module-test}_TESTS_FOR ${otb-module})
   endif()
 
+  # Exclude remote modules from default modules so that they are
+  # enabled/disabled using their variable Module_XXXX
+  get_filename_component(_group ${${otb-module}_BASE} PATH)
+  get_filename_component(_group ${_group} NAME)
+  if("${_group}" STREQUAL "Remote")
+    set(OTB_MODULE_${otb-module}_EXCLUDE_FROM_DEFAULT 1)
+  endif()
+
   # Reject bad dependencies.
   string(REGEX MATCHALL ";(OTBDeprecated|OTBReview|OTBIntegratedTest);"
     _bad_deps ";${OTB_MODULE_${otb-module}_DEPENDS};${OTB_MODULE_${otb-module-test}_DEPENDS};")
-- 
GitLab