diff --git a/CMake/OTBModuleEnablement.cmake b/CMake/OTBModuleEnablement.cmake index 749a3b375f109c24c8050f4d4384a7a06f5b99f7..4ec34d94df5315c4381769b3c33a380358163a86 100644 --- a/CMake/OTBModuleEnablement.cmake +++ b/CMake/OTBModuleEnablement.cmake @@ -157,14 +157,18 @@ macro(otb_module_enable otb-module _needed_by) endif() if(NOT ${otb-module}_ENABLED) set(${otb-module}_ENABLED 1) - foreach(dep IN LISTS OTB_MODULE_${otb-module}_DEPENDS) - otb_module_enable(${dep} ${otb-module}) - endforeach() - foreach(dep IN LISTS OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS) - otb_module_enable(${dep} ${otb-module}) - endforeach() - if(${otb-module}_TESTED_BY AND (OTB_BUILD_DEFAULT_MODULES OR OTB_BUILD_ALL_MODULES_FOR_TESTS OR Module_${otb-module})) - otb_module_enable(${${otb-module}_TESTED_BY} "") + # if this module has an ACTIVATION_OPTION=OFF, don't bother enable its dependencies + if(NOT (OTB_MODULE_${otb-module}_ACTIVATION_OPTION + AND NOT ${OTB_MODULE_${otb-module}_ACTIVATION_OPTION})) + foreach(dep IN LISTS OTB_MODULE_${otb-module}_DEPENDS) + otb_module_enable(${dep} ${otb-module}) + endforeach() + foreach(dep IN LISTS OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS) + otb_module_enable(${dep} ${otb-module}) + endforeach() + if(${otb-module}_TESTED_BY AND (OTB_BUILD_DEFAULT_MODULES OR OTB_BUILD_ALL_MODULES_FOR_TESTS OR Module_${otb-module})) + otb_module_enable(${${otb-module}_TESTED_BY} "") + endif() endif() endif() endmacro() diff --git a/Modules/ThirdParty/GeoTIFF/otb-module.cmake b/Modules/ThirdParty/GeoTIFF/otb-module.cmake index 0f331ec1574388189090987f879cea0e05cef9ab..8fbc7b52481a0374426fbede32743bae1da7b6d4 100644 --- a/Modules/ThirdParty/GeoTIFF/otb-module.cmake +++ b/Modules/ThirdParty/GeoTIFF/otb-module.cmake @@ -27,4 +27,6 @@ otb_module(OTBGeoTIFF DESCRIPTION "${DOCUMENTATION}" + + EXCLUDE_FROM_DEFAULT )