Defining a new module in opencv_contrib
Are there any guidelines on creating new modules in opencv_contrib?
I am trying to port my standalone project to a contrib module.
Most modules in contrib have a description and ocv_define_module(module_name [list of opencv modules used])
, however I am met with various errors such as "Exporting the target is not allowed since its linker
language cannot be determined" (normally fixed by project(NAME C CXX)
). How is this dealt with when contributing to opencv?
see plot module. it is a good prototype for beginning
@sturkmen Thanks for the suggestion - I have already checked a few of the other modules. There are a few things that are more complicated, I think and I'm not sure how to deal with - such as requiring C++11 only for my module (if I altered CMAKE_CXX_FLAGS inside my cmake file, that would be carried on to any other modules), or adding my Doxygen targets and my tests so that opencv builds them
I guess one of the following flags can help you to check if C++11 has been enabled: flag1 or flag2. You should make this a hard dependency and else force user to set it before building it. Best is to return an error in CMAKE config that it is missing and therefore your module is not build. Same happens with some modules that depend on CERES solver.