Commit eab17f35 authored by Christophe Palmann's avatar Christophe Palmann

ENH: fixed otbTrainOGRLayersClassifier and OGRLayerClassifier apps comp. when...

ENH: fixed otbTrainOGRLayersClassifier and OGRLayerClassifier apps comp. when libsvm and opencv modules are not installed
parent 815e01c4
......@@ -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
}
};
......
......@@ -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
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment