Commit 90555dbd authored by Suleyman TURKMEN's avatar Suleyman TURKMEN

makes text module dependency optional

parent 09fd78e4
set(the_description "datasets framework") set(the_description "datasets framework")
ocv_define_module(datasets opencv_core opencv_imgcodecs opencv_ml opencv_flann opencv_text WRAP python) ocv_define_module(datasets opencv_core opencv_imgcodecs opencv_ml opencv_flann OPTIONAL opencv_text WRAP python)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # flann, Win64 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # flann, Win64
...@@ -39,10 +39,13 @@ ...@@ -39,10 +39,13 @@
// //
//M*/ //M*/
#include "opencv2/datasets/tr_chars.hpp" #include <iostream>
#include <opencv2/opencv_modules.hpp>
#include <opencv2/core.hpp> #ifdef HAVE_OPENCV_TEXT
#include "opencv2/datasets/tr_chars.hpp"
#include <opencv2/core.hpp>
#include "opencv2/text.hpp" #include "opencv2/text.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp" #include "opencv2/imgcodecs.hpp"
...@@ -127,3 +130,13 @@ int main(int argc, char *argv[]) ...@@ -127,3 +130,13 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
#else
int main()
{
std::cerr << "OpenCV was built without text module" << std::endl;
return 0;
}
#endif // HAVE_OPENCV_TEXT
...@@ -39,10 +39,13 @@ ...@@ -39,10 +39,13 @@
// //
//M*/ //M*/
#include "opencv2/datasets/tr_icdar.hpp" #include <iostream>
#include <opencv2/opencv_modules.hpp>
#include <opencv2/core.hpp> #ifdef HAVE_OPENCV_TEXT
#include "opencv2/datasets/tr_icdar.hpp"
#include <opencv2/core.hpp>
#include "opencv2/text.hpp" #include "opencv2/text.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp" #include "opencv2/imgcodecs.hpp"
...@@ -50,8 +53,6 @@ ...@@ -50,8 +53,6 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -509,3 +510,13 @@ int main(int argc, char *argv[]) ...@@ -509,3 +510,13 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
#else
int main()
{
std::cerr << "OpenCV was built without text module" << std::endl;
return 0;
}
#endif // HAVE_OPENCV_TEXT
...@@ -39,10 +39,13 @@ ...@@ -39,10 +39,13 @@
// //
//M*/ //M*/
#include "opencv2/datasets/tr_svt.hpp" #include <iostream>
#include <opencv2/opencv_modules.hpp>
#include <opencv2/core.hpp> #ifdef HAVE_OPENCV_TEXT
#include "opencv2/datasets/tr_svt.hpp"
#include <opencv2/core.hpp>
#include "opencv2/text.hpp" #include "opencv2/text.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp" #include "opencv2/imgcodecs.hpp"
...@@ -50,8 +53,6 @@ ...@@ -50,8 +53,6 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <iostream>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -309,3 +310,13 @@ int main(int argc, char *argv[]) ...@@ -309,3 +310,13 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
#else
int main()
{
std::cerr << "OpenCV was built without text module" << std::endl;
return 0;
}
#endif // HAVE_OPENCV_TEXT
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