diff --git a/Examples/BasicFilters/CMakeLists.txt b/Examples/BasicFilters/CMakeLists.txt
index c8fb34bd1304b95ad7c9f911bdf275115fd10b84..858e0fa5ae8d0fa920aa9e08e4c0aca335c57fe7 100644
--- a/Examples/BasicFilters/CMakeLists.txt
+++ b/Examples/BasicFilters/CMakeLists.txt
@@ -1,10 +1,16 @@
 project(BasicFiltersExamples)
 
+#OTB_USE_MUPARSER is OFF
+if(OTBMathParser_LOADED)
 add_executable(BandMathFilterExample BandMathFilterExample.cxx)
 target_link_libraries(BandMathFilterExample ${OTB_LIBRARIES})
+endif()
 
+#OTB_USE_MUPARSERX is OFF
+if(OTBMathParserX_LOADED)
 add_executable(BandMathXImageFilterExample BandMathXImageFilterExample.cxx)
 target_link_libraries(BandMathXImageFilterExample ${OTB_LIBRARIES})
+endif()
 
 add_executable(DEMToRainbowExample DEMToRainbowExample.cxx)
 target_link_libraries(DEMToRainbowExample ${OTB_LIBRARIES})
@@ -21,8 +27,11 @@ target_link_libraries(IndexedToRGBExample ${OTB_LIBRARIES})
 add_executable(LeeImageFilter LeeImageFilter.cxx)
 target_link_libraries(LeeImageFilter ${OTB_LIBRARIES})
 
+#OTBMeanShift depends OTBMathParser. But OTB_USE_MUPARSER is OFF
+if(OTBMathParser_LOADED)
 add_executable(MeanShiftSegmentationFilterExample MeanShiftSegmentationFilterExample.cxx)
 target_link_libraries(MeanShiftSegmentationFilterExample ${OTB_LIBRARIES})
+endif()
 
 add_executable(PrintableImageFilterExample PrintableImageFilterExample.cxx)
 target_link_libraries(PrintableImageFilterExample ${OTB_LIBRARIES})
diff --git a/Examples/BasicFilters/test/CMakeLists.txt b/Examples/BasicFilters/test/CMakeLists.txt
index 15da042a010e826cedf26779452177d37a1b5f89..cc6dabe32daa2c486acaed79481b64b63d287baf 100644
--- a/Examples/BasicFilters/test/CMakeLists.txt
+++ b/Examples/BasicFilters/test/CMakeLists.txt
@@ -84,7 +84,7 @@ otb_add_test(NAME bfTeIndexedToRGBExampleTest COMMAND ${OTB_TEST_DRIVER}
     ${TEMP}/buildingExtractionRGB.png
     ${TEMP}/buildingExtractionIndexed_scaled.png
 )
-
+if(OTBMathParser_LOADED)
 otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-n-images ${NOTOL} 4
     ${BASELINE}/MSClusteredOutput.tif
@@ -107,7 +107,7 @@ otb_add_test(NAME bfTeMeanShiftSegmentationFilterExampleTest COMMAND ${OTB_TEST_
     100
     0.1
 )
-
+endif()
 # ------- HillShadingExampleTest ----------
 
 otb_add_test(NAME bfTeHillShadingExampleTest COMMAND ${OTB_TEST_DRIVER}
diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt
index 639761a6c6e94b30538e8febb535134ca33c6b1a..84b3542f4f25ff3f52fa79e88c29e1f1b99bb3ba 100644
--- a/Examples/CMakeLists.txt
+++ b/Examples/CMakeLists.txt
@@ -81,32 +81,12 @@ if(PROJECT_NAME STREQUAL "OTBExamples")
 
   ########################## end copied from OTB/CMakeLists.txt ##########################
 
-  #must be updated for new modules!
-  set(REQUIRED_MODULES "OTB6S;OTBITK;OTBAnomalyDetection;OTBBoost;OTBCommon;OTBGDAL;OTBOpenThreads;OTBOssim;OTBGeoTIFF;OTBOssimPlugins;OTBOSSIMAdapters;OTBObjectList;OTBMetadata;OTBImageBase;OTBBoostAdapters;OTBGdalAdapters;OTBTinyXML;OTBVectorDataBase;OTBIOGDAL;OTBExtendedFilename;OTBIOBSQ;OTBIOLUM;OTBIOMSTAR;OTBIOMW;OTBIOONERA;OTBIORAD;OTBCurl;OTBCurlAdapters;OTBIOTileMap;OTBStreaming;OTBImageIO;OTBInterpolation;OTBTransform;OTBImageManipulation;OTBTestKernel;OTBPath;OTBVectorDataManipulation;OTBProjection;OTBlibkml;OTBIOKML;OTBVectorDataIO;OTBApplicationEngine;OTBStatistics;OTBChangeDetection;OTBAppChangeDetection;OTBCommandLine;OTBColorMap;OTBMoments;OTBLabelMap;OTBConversion;OTBFuzzy;OTBMuParser;OTBMathParser;OTBSupervised;OTBDempsterShafer;OTBIOXML;OTBIndices;OTBMajorityVoting;OTBSOM;OTBAppClassification;OTBPointSet;OTBSiftFast;OTBDescriptors;OTBAppDescriptors;OTBDimensionalityReduction;OTBAppDimensionalityReduction;OTBSpatialObjects;OTBEdge;OTBAppEdge;OTBImageNoise;OTBAppFiltering;OTBConvolution;OTBPanSharpening;OTBAppFusion;OTBEndmembersExtraction;OTBWavelet;OTBUnmixing;OTBAppHyperspectral;OTBCarto;OTBAppImageUtils;OTBAppIndices;OTBKMZWriter;OTBAppKMZ;OTBAppMathParser;OTBMuParserX;OTBMathParserX;OTBAppMathParserX;OTBAppMoments;OTBAppMorphology;OTBOpticalCalibration;OTBAppOpticalCalibration;OTBAppProjection;OTBSARCalibration;OTBAppSARCalibration;OTBCCOBIA;OTBSmoothing;OTBMeanShift;OTBMetrics;OTBMorphologicalProfiles;OTBLabelling;OTBOGRProcessing;OTBWatersheds;OTBAppSegmentation;OTBDEM;OTBStereo;OTBDisparityMap;OTBAppStereo;OTBAppTest;OTBTextures;OTBAppTextures;OTBAppVectorDataTranslation;OTBAppVectorUtils;OTBCommandLineParser;OTBOpenThreadsAdapters;OTBCloudDetection;OTBComplexImage;OTBCorner;OTBDensity;OTBDisplacementField;OTBLandSatClassifier;OTBLearningBase;OTBMarkov;OTBMorphologicalPyramid;OTBObjectDetection;OTBPolarimetry;OTBRoadExtraction;OTBRCC8;OTBSWIGWrapper;OTBSeamCarving;OTBSimulation;OTBTimeSeries;OTBUrbanArea")
-
-  find_package(OTB REQUIRED COMPONENTS ${REQUIRED_MODULES})
-  include(${OTB_USE_FILE})
-  message(STATUS "Found OTB: ${OTB_USE_FILE}")
-
-else()
-  if(NOT OTB_BUILD_DEFAULT_MODULES)
-    message(FATAL_ERROR "BUILD_EXAMPLES requires OTB_BUILD_DEFAULT_MODULES to be ON")
-  endif()
-  # We also need to prevent any OTB_USE_XXX option to be OFF (except mapnik and openjpeg)
-  # For now we parse module activation list and test if option is ON. If not the cmake configuration stop.
-  #TODO We should provide a better mechanism here wich will deactivate only examples required by deactivated options.
-  foreach (_activationOption ${OTB_MODULE_ACTIVATION_OPTION_LIST})
-    if(NOT ${_activationOption} AND NOT "x${_activationOption}" STREQUAL "xOTB_USE_MAPNIK" AND NOT "x${_activationOption}" STREQUAL "xOTB_USE_OPENJPEG")
-      message(FATAL_ERROR "BUILD_EXAMPLES requires ${_activationOption} to be ON")
-    endif()
-  endforeach()
-
-  find_package(OTB REQUIRED)
-  include(${OTB_USE_FILE})
-  message(STATUS "Found OTB: ${OTB_USE_FILE}")
-
 endif()
 
+find_package(OTB REQUIRED)
+include(${OTB_USE_FILE})
+message(STATUS "Found OTB: ${OTB_USE_FILE}")
+
 set(OTB_TEST_DRIVER otbTestDriver)
 
 if(OTBApplicationEngine_LOADED)
diff --git a/Examples/Classification/CMakeLists.txt b/Examples/Classification/CMakeLists.txt
index 4aa4757783949ef289edc2dac459ff6805d25e64..02db6fd752225dc4bbf2508b347b7c7257dfd155 100644
--- a/Examples/Classification/CMakeLists.txt
+++ b/Examples/Classification/CMakeLists.txt
@@ -6,9 +6,11 @@ target_link_libraries(BayesianPluginClassifier ${OTB_LIBRARIES})
 add_executable(ClassificationMapRegularizationExample ClassificationMapRegularizationExample.cxx)
 target_link_libraries(ClassificationMapRegularizationExample ${OTB_LIBRARIES})
 
+#OTBDempsterShafer depends OTBMathParser. But OTB_USE_MUPARSER is OFF
+if(OTBMathParser_LOADED)
 add_executable(DempsterShaferFusionOfClassificationMapsExample DempsterShaferFusionOfClassificationMapsExample.cxx)
 target_link_libraries(DempsterShaferFusionOfClassificationMapsExample ${OTB_LIBRARIES})
-
+endif()
 add_executable(ExpectationMaximizationMixtureModelEstimator ExpectationMaximizationMixtureModelEstimator.cxx)
 target_link_libraries(ExpectationMaximizationMixtureModelEstimator ${OTB_LIBRARIES})
 
diff --git a/Examples/DisparityMap/CMakeLists.txt b/Examples/DisparityMap/CMakeLists.txt
index bd7b2c26c86cd6fb2fdbfa84dbcc28f8f200ecbc..f42b945930e97fd1cfa30117302d08759a1dc44e 100644
--- a/Examples/DisparityMap/CMakeLists.txt
+++ b/Examples/DisparityMap/CMakeLists.txt
@@ -9,8 +9,11 @@ target_link_libraries(NCCRegistrationFilterExample ${OTB_LIBRARIES})
 add_executable(SimpleDisparityMapEstimationExample SimpleDisparityMapEstimationExample.cxx)
 target_link_libraries(SimpleDisparityMapEstimationExample ${OTB_LIBRARIES})
 
+#StereoReconstructionExample depends OTBMathParser. But OTB_USE_MUPARSER is OFF
+if(OTBMathParser_LOADED)
 add_executable(StereoReconstructionExample StereoReconstructionExample.cxx)
 target_link_libraries(StereoReconstructionExample ${OTB_LIBRARIES})
+endif()
 
 if(BUILD_TESTING)
   add_subdirectory(test)
diff --git a/Examples/DisparityMap/test/CMakeLists.txt b/Examples/DisparityMap/test/CMakeLists.txt
index d90913ccfcaca5de71692741ba78d7765020168b..9c247434b91ffb8e9116882b05e8538380ae513d 100644
--- a/Examples/DisparityMap/test/CMakeLists.txt
+++ b/Examples/DisparityMap/test/CMakeLists.txt
@@ -17,6 +17,7 @@ otb_add_test(NAME dmTeSimpleDisparityMapEstimationExampleTest COMMAND ${OTB_TEST
     100 10 15 10 10 250 0.9
 )
 
+if(OTBMathParser_LOADED)
 otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-image ${NOTOL}
     ${BASELINE}/elevationOutput.tif
@@ -28,3 +29,4 @@ otb_add_test(NAME dmTeStereoReconstructionExampleTest COMMAND ${OTB_TEST_DRIVER}
     ${TEMP}/elevationOutputPrintable.png
     140
 )
+endif()
\ No newline at end of file
diff --git a/Examples/FeatureExtraction/CMakeLists.txt b/Examples/FeatureExtraction/CMakeLists.txt
index ec46f9fd89a8065e4ac0d0b713aca977c89311eb..edce7bf6fac9ecc829033a2531cf3be9d5f4957c 100644
--- a/Examples/FeatureExtraction/CMakeLists.txt
+++ b/Examples/FeatureExtraction/CMakeLists.txt
@@ -1,8 +1,5 @@
 project(FeatureExtractionExamples)
 
-add_executable(AlignmentsExample AlignmentsExample.cxx)
-target_link_libraries(AlignmentsExample ${OTB_LIBRARIES})
-
 add_executable(AssymmetricFusionOfLineDetectorExample AssymmetricFusionOfLineDetectorExample.cxx)
 target_link_libraries(AssymmetricFusionOfLineDetectorExample ${OTB_LIBRARIES})
 
@@ -21,12 +18,21 @@ target_link_libraries(CorrelationLineDetectorExample ${OTB_LIBRARIES})
 add_executable(EdgeDensityExample EdgeDensityExample.cxx)
 target_link_libraries(EdgeDensityExample ${OTB_LIBRARIES})
 
+#OTBRoadExtraction depends OTBMathParser. But OTB_USE_MUPARSER is OFF
+if(OTBMathParser_LOADED)
 add_executable(ExtractRoadByStepsExample ExtractRoadByStepsExample.cxx)
 target_link_libraries(ExtractRoadByStepsExample ${OTB_LIBRARIES})
 
 add_executable(ExtractRoadExample ExtractRoadExample.cxx)
 target_link_libraries(ExtractRoadExample ${OTB_LIBRARIES})
 
+add_executable(ParallelLineDetectionExample ParallelLineDetectionExample.cxx)
+target_link_libraries(ParallelLineDetectionExample ${OTB_LIBRARIES})
+
+add_executable(AlignmentsExample AlignmentsExample.cxx)
+target_link_libraries(AlignmentsExample ${OTB_LIBRARIES})
+endif()
+
 add_executable(ExtractSegmentsByStepsExample ExtractSegmentsByStepsExample.cxx)
 target_link_libraries(ExtractSegmentsByStepsExample ${OTB_LIBRARIES})
 
@@ -45,6 +51,9 @@ target_link_libraries(HuMomentsImageFunctionExample ${OTB_LIBRARIES})
 if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK)
   add_executable(LineSegmentDetectorExample LineSegmentDetectorExample.cxx)
   target_link_libraries(LineSegmentDetectorExample ${OTB_LIBRARIES})
+
+  add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx)
+  target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES})
 endif()
 
 add_executable(LocalHoughExample LocalHoughExample.cxx)
@@ -53,17 +62,9 @@ target_link_libraries(LocalHoughExample ${OTB_LIBRARIES})
 add_executable(PanTexExample PanTexExample.cxx)
 target_link_libraries(PanTexExample ${OTB_LIBRARIES})
 
-add_executable(ParallelLineDetectionExample ParallelLineDetectionExample.cxx)
-target_link_libraries(ParallelLineDetectionExample ${OTB_LIBRARIES})
-
 add_executable(RatioLineDetectorExample RatioLineDetectorExample.cxx)
 target_link_libraries(RatioLineDetectorExample ${OTB_LIBRARIES})
 
-if (Module_OTBVectorDataRendering AND OTB_USE_MAPNIK)
-  add_executable(RightAngleDetectionExample RightAngleDetectionExample.cxx)
-  target_link_libraries(RightAngleDetectionExample ${OTB_LIBRARIES})
-endif()
-
 add_executable(SeamCarvingExample SeamCarvingExample.cxx)
 target_link_libraries(SeamCarvingExample ${OTB_LIBRARIES})
 
diff --git a/Examples/FeatureExtraction/test/CMakeLists.txt b/Examples/FeatureExtraction/test/CMakeLists.txt
index 9e351acd2adf21b663afe76885b8baf7d868e91e..b748caca32cb41a2726011dc662e4836b98b86c2 100644
--- a/Examples/FeatureExtraction/test/CMakeLists.txt
+++ b/Examples/FeatureExtraction/test/CMakeLists.txt
@@ -107,7 +107,7 @@ otb_add_test(NAME feTeRatioLineDetectorExampleTest COMMAND ${OTB_TEST_DRIVER}
 )
 
 # ------- AlignmentsExampleTest----------
-
+if(OTBMathParser_LOADED)
 otb_add_test(NAME feTeAlignmentsExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-n-images ${NOTOL} 1
     ${BASELINE}/QB_SuburbAlign.png
@@ -145,6 +145,8 @@ otb_add_test(NAME feTeExtractRoadExampleTest COMMAND ${OTB_TEST_DRIVER}
     337 557 432 859 1.0 0.00005 1.0 0.39269 1.0 10.0 25.
 )
 
+endif()
+
 # ------- SeamCarvingExamplesTest----------
 
 otb_add_test(NAME feTeSeamCarvingExampleTest COMMAND ${OTB_TEST_DRIVER}
diff --git a/Examples/IO/CMakeLists.txt b/Examples/IO/CMakeLists.txt
index a3d9b9063fee339286f5cc7b487d49560cf437d1..b4395d43a10ab34ded19381a315d54c89537d8a5 100644
--- a/Examples/IO/CMakeLists.txt
+++ b/Examples/IO/CMakeLists.txt
@@ -30,8 +30,10 @@ target_link_libraries(ImageReadWrite ${OTB_LIBRARIES})
 add_executable(ImageSeriesIOExample ImageSeriesIOExample.cxx)
 target_link_libraries(ImageSeriesIOExample ${OTB_LIBRARIES})
 
+if(OTBlibkml_LOADED)
 add_executable(ImageToKmzAndMapFileProductExample ImageToKmzAndMapFileProductExample.cxx)
 target_link_libraries(ImageToKmzAndMapFileProductExample ${OTB_LIBRARIES})
+endif()
 
 add_executable(MetadataExample MetadataExample.cxx)
 target_link_libraries(MetadataExample ${OTB_LIBRARIES})
diff --git a/Examples/IO/test/CMakeLists.txt b/Examples/IO/test/CMakeLists.txt
index d75692eee9a507dd0f5587cf7b209beabfef4565..720b16203b632a95e2d850822f5d722a875c9653 100644
--- a/Examples/IO/test/CMakeLists.txt
+++ b/Examples/IO/test/CMakeLists.txt
@@ -43,6 +43,7 @@ otb_add_test(NAME prTeDEMHandlerExampleTest COMMAND ${OTB_TEST_DRIVER}
     0.001
 )
 
+if(OTBlibkml_LOADED)
 otb_add_test(NAME ioTeImageToKmzAndMapFileProductExample COMMAND ${OTB_TEST_DRIVER}
   Execute $<TARGET_FILE:ImageToKmzAndMapFileProductExample>
     ${OTB_DATA_ROOT}/Input/Haiti1_sr10.jpeg
@@ -78,6 +79,7 @@ otb_add_test(NAME ioTeImageToKmzAndMapFileProductExample COMMAND ${OTB_TEST_DRIV
     42.000000  232.000000 -72.426552 18.540876 0.000000
 )
 set_property(TEST ioTeImageToKmzAndMapFileProductExample PROPERTY RESOURCE_LOCK web_access)
+endif()
 
 otb_add_test(NAME ioTeTileMapImageIOExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-image 10.0
diff --git a/Examples/Learning/CMakeLists.txt b/Examples/Learning/CMakeLists.txt
index 4963ecaed02cf4ac4a55240d66352d464e04d13b..cbf51262616e251ee86d0bd3c921ac35cd7b4d92 100644
--- a/Examples/Learning/CMakeLists.txt
+++ b/Examples/Learning/CMakeLists.txt
@@ -12,6 +12,7 @@ target_link_libraries(SOMClassifierExample ${OTB_LIBRARIES})
 add_executable(SOMExample SOMExample.cxx)
 target_link_libraries(SOMExample ${OTB_LIBRARIES})
 
+if(OTBLibSVM_LOADED)
 add_executable(SVMImageClassificationExample SVMImageClassificationExample.cxx)
 target_link_libraries(SVMImageClassificationExample ${OTB_LIBRARIES})
 
@@ -29,13 +30,15 @@ target_link_libraries(SVMPointSetExample ${OTB_LIBRARIES})
 
 add_executable(SVMPointSetModelEstimatorExample SVMPointSetModelEstimatorExample.cxx)
 target_link_libraries(SVMPointSetModelEstimatorExample ${OTB_LIBRARIES})
+endif()
 
+if(OTBOpenCV_LOADED)
 add_executable(TrainMachineLearningModelFromImagesExample TrainMachineLearningModelFromImagesExample.cxx)
 target_link_libraries(TrainMachineLearningModelFromImagesExample ${OTB_LIBRARIES})
 
 add_executable(TrainMachineLearningModelFromSamplesExample TrainMachineLearningModelFromSamplesExample.cxx)
 target_link_libraries(TrainMachineLearningModelFromSamplesExample ${OTB_LIBRARIES})
-
+endif()
 
 if(BUILD_TESTING)
   add_subdirectory(test)
diff --git a/Examples/Learning/test/CMakeLists.txt b/Examples/Learning/test/CMakeLists.txt
index d3918e252e6901babd9924b0dc092e302acc99fb..71e51049f8a57ffdca32b7606c1bcc034e7e467f 100644
--- a/Examples/Learning/test/CMakeLists.txt
+++ b/Examples/Learning/test/CMakeLists.txt
@@ -3,6 +3,7 @@ set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
 
 # ------- SVMImageClassificationExampleTest----------
 
+if(OTBLibSVM_LOADED)
 otb_add_test(NAME leTeSVMImageClassificationExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-n-images ${NOTOL} 1
     ${BASELINE}/ROI_QB_MUL_1_SVN_CLASS.png
@@ -26,18 +27,6 @@ otb_add_test(NAME leTeSVMImageEstimatorClassificationMultiExampleTest COMMAND ${
     ${TEMP}/ROI_QB_MUL_1_SVN_CLASS_MULTI_Rescaled.png
 )
 
-# ------- GenerateTrainingImageExampleTest----------
-
-otb_add_test(NAME leTeGenerateTrainingImageExampleTest COMMAND ${OTB_TEST_DRIVER}
-  --compare-n-images ${NOTOL} 1
-    ${BASELINE}/ROI_QB_MUL_4_training.png
-    ${TEMP}/ROI_QB_MUL_4_training.png
-  Execute $<TARGET_FILE:GenerateTrainingImageExample>
-    ${INPUTDATA}/ROI_QB_MUL_4.tif
-    ${INPUTDATA}/LearningROIs.txt
-    ${TEMP}/ROI_QB_MUL_4_training.png
-)
-
 # ------- SVMImageModelEstimatorExampleTest----------
 
 otb_add_test(NAME leTeSVMImageModelEstimatorExampleTest COMMAND ${OTB_TEST_DRIVER}
@@ -51,6 +40,18 @@ otb_add_test(NAME leTeSVMImageModelEstimatorExampleTest COMMAND ${OTB_TEST_DRIVE
     ${TEMP}/svm_image_model.svn
 )
 
+endif()
+# ------- GenerateTrainingImageExampleTest----------
+
+otb_add_test(NAME leTeGenerateTrainingImageExampleTest COMMAND ${OTB_TEST_DRIVER}
+  --compare-n-images ${NOTOL} 1
+    ${BASELINE}/ROI_QB_MUL_4_training.png
+    ${TEMP}/ROI_QB_MUL_4_training.png
+  Execute $<TARGET_FILE:GenerateTrainingImageExample>
+    ${INPUTDATA}/ROI_QB_MUL_4.tif
+    ${INPUTDATA}/LearningROIs.txt
+    ${TEMP}/ROI_QB_MUL_4_training.png
+)
 
 # ------- SOMExampleTest----------
 
diff --git a/Examples/OBIA/CMakeLists.txt b/Examples/OBIA/CMakeLists.txt
index 202bd7ae29ce81a684e3b81211dd9ba8b3ff1cca..d2f7a79be47c7627549c03ac3f633fdaafb88fa9 100644
--- a/Examples/OBIA/CMakeLists.txt
+++ b/Examples/OBIA/CMakeLists.txt
@@ -12,8 +12,10 @@ target_link_libraries(KeepNObjects ${OTB_LIBRARIES})
 add_executable(LabelMapToVectorData LabelMapToVectorData.cxx)
 target_link_libraries(LabelMapToVectorData ${OTB_LIBRARIES})
 
+if(OTBMathParser_LOADED)
 add_executable(RadiometricAttributesLabelMapFilterExample RadiometricAttributesLabelMapFilterExample.cxx)
 target_link_libraries(RadiometricAttributesLabelMapFilterExample ${OTB_LIBRARIES})
+endif()
 
 add_executable(ShapeAttributeComputation ShapeAttributeComputation.cxx)
 target_link_libraries(ShapeAttributeComputation ${OTB_LIBRARIES})
diff --git a/Examples/OBIA/test/CMakeLists.txt b/Examples/OBIA/test/CMakeLists.txt
index 83a32c6339f4503a4fe36a72e982a6ea9bb559a5..f3c92b30ea3d96bd545bc5c333539db8274a8c5a 100644
--- a/Examples/OBIA/test/CMakeLists.txt
+++ b/Examples/OBIA/test/CMakeLists.txt
@@ -22,6 +22,7 @@ otb_add_test(NAME trTeOBIAShapeAttributeComputationTest COMMAND ${OTB_TEST_DRIVE
     ${TEMP}/OBIAShapeAttribute.txt
 )
 
+if(OTBMathParser_LOADED)
 otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_TEST_DRIVER}
   --compare-image ${NOTOL}
     ${BASELINE}/OBIARadiometricAttributes.png
@@ -38,6 +39,7 @@ otb_add_test(NAME trTeOBIARadiometricAttributesLabelMapFilterTest COMMAND ${OTB_
     50
     1.0
 )
+endif()
 
 otb_add_test(NAME trTeLabelMapToVectorData COMMAND ${OTB_TEST_DRIVER}
   Execute $<TARGET_FILE:LabelMapToVectorData>
diff --git a/Examples/Patented/CMakeLists.txt b/Examples/Patented/CMakeLists.txt
index 07210c89bb2bc23db170f3b3d57925bfca0143c3..8648e956aa89809bf1eb6c47c21b1a3436fd0ddf 100644
--- a/Examples/Patented/CMakeLists.txt
+++ b/Examples/Patented/CMakeLists.txt
@@ -3,18 +3,18 @@ project(PatentedExamples)
 add_executable(EstimateAffineTransformationExample EstimateAffineTransformationExample.cxx)
 target_link_libraries(EstimateAffineTransformationExample ${OTB_LIBRARIES})
 
+if (OTBSiftFast_LOADED)
 add_executable(SIFTDisparityMapEstimation SIFTDisparityMapEstimation.cxx)
 target_link_libraries(SIFTDisparityMapEstimation ${OTB_LIBRARIES})
 
 add_executable(SIFTExample SIFTExample.cxx)
 target_link_libraries(SIFTExample ${OTB_LIBRARIES})
 
-if (Module_OTBSiftFast)
-  add_executable(SIFTDensityExample SIFTDensityExample.cxx)
-  target_link_libraries(SIFTDensityExample ${OTB_LIBRARIES})
+add_executable(SIFTDensityExample SIFTDensityExample.cxx)
+target_link_libraries(SIFTDensityExample ${OTB_LIBRARIES})
 
-  add_executable(SIFTFastExample SIFTFastExample.cxx)
-  target_link_libraries(SIFTFastExample ${OTB_LIBRARIES})
+add_executable(SIFTFastExample SIFTFastExample.cxx)
+target_link_libraries(SIFTFastExample ${OTB_LIBRARIES})
 endif()
 
 if(BUILD_TESTING)
diff --git a/Examples/Radiometry/CMakeLists.txt b/Examples/Radiometry/CMakeLists.txt
index 1c1e1bd3de3339396735c49983ca9509886d2c69..48c5d40d071238dd5dcd547fe80ac56f095adb08 100644
--- a/Examples/Radiometry/CMakeLists.txt
+++ b/Examples/Radiometry/CMakeLists.txt
@@ -3,8 +3,11 @@ project(RadiometryExamples)
 add_executable(ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.cxx)
 target_link_libraries(ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter ${OTB_LIBRARIES})
 
+#OTBOpticalCalibration -> OTB6S
+if(OTB6S_LOADED)
 add_executable(AtmosphericCorrectionSequencement AtmosphericCorrectionSequencement.cxx)
 target_link_libraries(AtmosphericCorrectionSequencement ${OTB_LIBRARIES})
+endif()
 
 add_executable(AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.cxx)
 target_link_libraries(AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter ${OTB_LIBRARIES})
diff --git a/Examples/Radiometry/test/CMakeLists.txt b/Examples/Radiometry/test/CMakeLists.txt
index ff18563ad9aff969b7e84a237a1efd7377c6235e..b77c8c87e51835fe4d227fbed00b77c68f78075c 100644
--- a/Examples/Radiometry/test/CMakeLists.txt
+++ b/Examples/Radiometry/test/CMakeLists.txt
@@ -52,6 +52,7 @@ otb_add_test(NAME raTeNDVIRAndNIRVegetationIndexImageFilterTest COMMAND ${OTB_TE
     ${TEMP}/NDVIRAndNIRVegetationIndex4.tif
 )
 
+if(OTBOpticalCalibration_LOADED)
 otb_add_test(NAME raTeAtmosphericCorrectionSequencementTest COMMAND ${OTB_TEST_DRIVER}
   --compare-image ${EPSILON_8}
     ${BASELINE}/Example_RomaniaAtmosphericCorrectionSequencement.tif
@@ -82,3 +83,4 @@ otb_add_test(NAME raTeAtmosphericCorrectionSequencementTest COMMAND ${OTB_TEST_D
     2       # Radius;
     0.020   # pixel spacing in kilometers
 )
+endif()
\ No newline at end of file
diff --git a/Examples/Segmentation/CMakeLists.txt b/Examples/Segmentation/CMakeLists.txt
index 4fb4b89300757a0a24a675165264b9dacfbc83e0..c8cda537c20a206fbb46e6b670948e1edfb0313b 100644
--- a/Examples/Segmentation/CMakeLists.txt
+++ b/Examples/Segmentation/CMakeLists.txt
@@ -24,8 +24,10 @@ target_link_libraries(OtsuMultipleThresholdImageFilter ${OTB_LIBRARIES})
 add_executable(OtsuThresholdImageFilter OtsuThresholdImageFilter.cxx)
 target_link_libraries(OtsuThresholdImageFilter ${OTB_LIBRARIES})
 
-add_executable(StreamingMeanShiftSegmentation StreamingMeanShiftSegmentation.cxx)
-target_link_libraries(StreamingMeanShiftSegmentation ${OTB_LIBRARIES})
+if(OTBMathParser_LOADED)
+  add_executable(StreamingMeanShiftSegmentation StreamingMeanShiftSegmentation.cxx)
+  target_link_libraries(StreamingMeanShiftSegmentation ${OTB_LIBRARIES})
+endif()
 
 add_executable(VectorConfidenceConnected VectorConfidenceConnected.cxx)
 target_link_libraries(VectorConfidenceConnected ${OTB_LIBRARIES})
diff --git a/Examples/Segmentation/test/CMakeLists.txt b/Examples/Segmentation/test/CMakeLists.txt
index d43f19ecf89f64747f546278e5a09bb23e6806c2..37d36f1ca5f27611eb1e31dd3951dd2bc56ceb4b 100644
--- a/Examples/Segmentation/test/CMakeLists.txt
+++ b/Examples/Segmentation/test/CMakeLists.txt
@@ -272,7 +272,7 @@ otb_add_test(NAME seTeLabelizeNeighborhoodConnectedImageFilterTest COMMAND ${OTB
 
 
 # ------- StreamingMeanShiftSegmentationTest ----------
-
+if(OTBMathParser_LOADED)
 otb_add_test(NAME seTeStreamingMeanShiftSegmentationTest COMMAND ${OTB_TEST_DRIVER}
   # --compare-ogr ${NOTOL}
   # ${BASELINE_FILES}/seTeStreamingMeanShiftSegmentationTest.shp
@@ -291,3 +291,4 @@ otb_add_test(NAME seTeStreamingMeanShiftSegmentationTest COMMAND ${OTB_TEST_DRIV
     1 #Simplify Flag
     0.2 #Simplification tolerance
 )
+endif()
\ No newline at end of file
diff --git a/Examples/Simulation/CMakeLists.txt b/Examples/Simulation/CMakeLists.txt
index ece736e87f61817c03a96ce358eebac6c368f355..0e0bc86b13a38327a5e71324c4972491e85c076e 100644
--- a/Examples/Simulation/CMakeLists.txt
+++ b/Examples/Simulation/CMakeLists.txt
@@ -1,14 +1,16 @@
 project(SimulationExamples)
 
+#OTBSimulation -> OTBOpticalCalibration -> OTB6S
+if(OTB6S_LOADED)
 add_executable(LAIAndPROSAILToSensorResponse LAIAndPROSAILToSensorResponse.cxx)
 target_link_libraries(LAIAndPROSAILToSensorResponse ${OTB_LIBRARIES})
 
-add_executable(LAIFromNDVIImageTransform LAIFromNDVIImageTransform.cxx)
-target_link_libraries(LAIFromNDVIImageTransform ${OTB_LIBRARIES})
-
 add_executable(ProsailModel ProsailModel.cxx)
 target_link_libraries(ProsailModel ${OTB_LIBRARIES})
+endif()
 
+add_executable(LAIFromNDVIImageTransform LAIFromNDVIImageTransform.cxx)
+target_link_libraries(LAIFromNDVIImageTransform ${OTB_LIBRARIES})
 
 if(BUILD_TESTING)
   add_subdirectory(test)
diff --git a/Examples/Simulation/test/CMakeLists.txt b/Examples/Simulation/test/CMakeLists.txt
index eed146c98e2e69eb94b99f1bda805b50254f4821..9cb0323021507d2671a12e1af58e015a5d4a796d 100644
--- a/Examples/Simulation/test/CMakeLists.txt
+++ b/Examples/Simulation/test/CMakeLists.txt
@@ -3,6 +3,8 @@ set(INPUTDATA ${OTB_DATA_ROOT}/Examples)
 
 # ------- ProsailModelExampleTest ----------
 
+#OTBSimulation -> OTBOpticalCalibration -> OTB6S
+if(OTB6S_LOADED)
 otb_add_test(NAME siTvProsailModelExampleTest COMMAND ${OTB_TEST_DRIVER}
   --compare-ascii ${EPSILON_3}
     ${BASELINE}/siTvProsailModelExampleTest.txt
@@ -25,20 +27,6 @@ otb_add_test(NAME siTvProsailModelExampleTest COMMAND ${OTB_TEST_DRIVER}
     ${TEMP}/siTvProsailModelExampleTest.txt
 )
 
-
-otb_add_test(NAME siTvLAIFromNDVIImageTransfromExampleTest  COMMAND ${OTB_TEST_DRIVER}
-  --compare-image ${EPSILON_8}
-    ${OTB_DATA_ROOT}/Baseline/OTB/Images/raRAndNIRVegetationIndex_LAIFromNDVIFormosat2_verySmallFSATSWcRcNir.tif
-    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
-  Execute $<TARGET_FILE:LAIFromNDVIImageTransform>
-    ${INPUTDATA}/verySmallFSATSW.tif
-    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
-    ${TEMP}/verySmallFSATSW_visu.png
-    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW_visu.png
-    1  # red
-    4  # nir
-)
-
 otb_add_test(NAME siTvLAIAndPROSAILToSensorResponseExampleTest  COMMAND ${OTB_TEST_DRIVER}
 --compare-image ${EPSILON_8}
   ${OTBAPP_BASELINE}/siTvLAIAndPROSAILToSensorResponseSmall.tif
@@ -54,3 +42,18 @@ Execute $<TARGET_FILE:LAIAndPROSAILToSensorResponse>
   5
   ${OTB_DATA_ROOT}/Input/
 )
+
+endif()
+
+otb_add_test(NAME siTvLAIFromNDVIImageTransfromExampleTest  COMMAND ${OTB_TEST_DRIVER}
+  --compare-image ${EPSILON_8}
+    ${OTB_DATA_ROOT}/Baseline/OTB/Images/raRAndNIRVegetationIndex_LAIFromNDVIFormosat2_verySmallFSATSWcRcNir.tif
+    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
+  Execute $<TARGET_FILE:LAIFromNDVIImageTransform>
+    ${INPUTDATA}/verySmallFSATSW.tif
+    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW.tif
+    ${TEMP}/verySmallFSATSW_visu.png
+    ${TEMP}/siTvLAIFromNDVIImageTransfromExampleTest_verySmallFSATSW_visu.png
+    1  # red
+    4  # nir
+)