Made samples build independent from nonfree module.
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
#include <stdio.h>
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
|
||||
#ifndef HAVE_OPENCV_NONFREE
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
printf("The sample requires nonfree module that is not available in your OpenCV distribution.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# include "opencv2/core/core.hpp"
|
||||
# include "opencv2/features2d/features2d.hpp"
|
||||
# include "opencv2/highgui/highgui.hpp"
|
||||
# include "opencv2/nonfree/nonfree.hpp"
|
||||
|
||||
using namespace cv;
|
||||
|
||||
@@ -56,3 +68,5 @@ int main(int argc, char** argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user