How to include OpenCV source code in C++ project to make it portable?

asked 2016-02-29 18:25:27 -0600

Nesbit gravatar image

In my C++ project I use (3.1) OpenCV Mat for (only) storing and operating matrices (thus only the core module is used).

Now I would like to make the code portable: if a user (running Linux or Windows or OS X) takes my code then he can compile and run it, without installing the whole OpenCV pack.

Moreover, I would like the user to run the fastest version of the code (i.e. compiled in Release mode, Optimizations, etc...).

Could you please suggest a way to do that?

I copied the source code from modules/cores to the project directory but not sure how to proceed. I guess I have to modify the original OpenCV CMakeLists to take into account only the core module, but the file looks complicated for me :(

Thank you in advance for any suggestions!

edit retag flag offensive close merge delete

Comments

copying parts of the src code sounds like a terrible idea.

there's a lot of work put into making opencv portable, you're defeating all of it this way.

berak gravatar imageberak ( 2016-03-01 00:21:14 -0600 )edit