diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index 5187de4bbb83f21c075a11c401706124a647434d..e01c08a67b663ed3b2a22872268aa1ab9ef33da8 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -26,7 +26,10 @@ #include "itkListSample.h" #include "otbShiftScaleSampleListFilter.h" + +#ifdef OTB_USE_LIBSVM #include "otbLibSVMMachineLearningModel.h" +#endif #include <time.h> @@ -119,6 +122,8 @@ private: void DoExecute() { + + #ifdef OTB_USE_LIBSVM clock_t tic = clock(); std::string shapefile = GetParameterString("inshp").c_str(); @@ -214,6 +219,11 @@ private: clock_t toc = clock(); otbAppLogINFO( "Elapsed: "<< ((double)(toc - tic) / CLOCKS_PER_SEC)<<" seconds."); + + #elseif + otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); + #endif + } }; diff --git a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx index 54141604e1742a426238355e5a21ec622ec2d242..2e4faf95514fe6e7aa2219ed86780604a3b644c6 100644 --- a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx @@ -26,7 +26,10 @@ #include "itkListSample.h" #include "otbShiftScaleSampleListFilter.h" + +#ifdef OTB_USE_LIBSVM #include "otbLibSVMMachineLearningModel.h" +#endif #include <time.h> @@ -118,6 +121,7 @@ private: void DoExecute() { + #ifdef OTB_USE_LIBSVM clock_t tic = clock(); std::string shapefile = GetParameterString("inshp"); @@ -197,6 +201,11 @@ private: clock_t toc = clock(); otbAppLogINFO( "Elapsed: "<< ((double)(toc - tic) / CLOCKS_PER_SEC)<<" seconds."); + + #elseif + otbAppLogFATAL("Module LIBSVM is not installed. You should consider turning OTB_USE_LIBSVM on during cmake configuration."); + #endif + } };