there is a BUILD_LIST
option for cmake, where you can specify exactly the opencv modules you want / need. (comma seperated list)
looking at the bioinspired's cmakelists.txt we see, that we need at least: opencv_core
(though, no idea, what your program really does, i guess you still need some more, e.g. for loading images, gui, etc.)
i'd propose the following cmake options:
-DOPENCV_EXTRA_MODULES=/where/you/put/contrib/modules/bioinspired
-DBUILD_LIST=bioinspired,core,imgcodecs,imgproc,highgui
-DBUILD_SHARED_LIBS=OFF
but note, that linking your program later to static libs is much more difficult, than the dynamic case, because you
- have to use the libs in dependancy order, e.g. anything dependant on core has to go before that in the list,
- have to add all the nessecary system libs (that were conveniently linked already when using so's) , like
-llibjpeg -lz -ldl
now, those have to go to the end of the list
getting this right, might prove a bit painful, just saying...
which contrib module is it ? (so we can look up the dependancies)
it's still pretty much the same receipe as here
to build static libs, you have to use:
cmake -DBUILD_SHARED_LIBS=OFF
Hello Berak, Thanks for your answer. The module I need to add is the Bioinspired module. Do you think I can optimized the static compile using just the necessary of OpenCV modules or I need to do it with the entire OpenCV lib ?
Thank you