Build both Python 2 and Python 3 bindings

This replaces #2912 and potentially #3040 by @vpisarev.

I have once again updated my branch with master.  To address @vpisarev's concerns about module naming conflicts, the generated library is placed inside of a dedicated folder inside of lib/.  This way, there can be no naming conflicts.

As an aside, it looks like the Buildbot machine needs some upgrades to properly test these changes.  The Linux machine appears to be missing the necessary Python 3 Numpy packages.  The Windows and Mac machine appear to be missing Python 3 altogether.
All right, I can update this to put Python 3 in a subdirectory, and not
Python 2.


On Wed, Aug 6, 2014 at 10:19 AM, Vadim Pisarevsky <notifications@github.com>
wrote:

> In modules/python/common.cmake:
>
> > +set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL)
> > +
> > +if(PYTHON_DEBUG_LIBRARIES AND NOT PYTHON_LIBRARIES MATCHES "optimized.*debug")
> > +  target_link_libraries(${the_module} debug ${PYTHON_DEBUG_LIBRARIES} optimized ${PYTHON_LIBRARIES})
> > +else()
> > +  target_link_libraries(${the_module} ${PYTHON_LIBRARIES})
> > +endif()
> > +target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
> > +
> > +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SO'))"
> > +                RESULT_VARIABLE PYTHON_CVPY_PROCESS
> > +                OUTPUT_VARIABLE CVPY_SUFFIX
> > +                OUTPUT_STRIP_TRAILING_WHITESPACE)
> > +
> > +set_target_properties(${the_module} PROPERTIES
> > +                      LIBRARY_OUTPUT_DIRECTORY  "${LIBRARY_OUTPUT_PATH}/${MODULE_NAME}"
>
> yes, this is why I suggest to change the build script instead of changing
> buildbot rules. it's not a single instance of buildbot, there are also
> other versions for internal branches. I would prefer that cv2.so stays
> where it's now
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Itseez/opencv/pull/3047/files#r15888447>.
>



-- 
Regards,
Michael Pratt