Build WITH_OPENGL option not available even if building with QT on Mac OS X (Bug #3437)


Added by Oliver Wilkie about 11 years ago. Updated about 11 years ago.


Status:Done Start date:2013-12-16
Priority:Normal Due date:
Assignee:Ilya Lavrenov % Done:

100%

Category:highgui-gui
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Mac OSX
Difficulty:Medium HW Platform:Any
Pull request:https://github.com/Itseez/opencv/pull/2329

Description

In this bug one year ago http://code.opencv.org/issues/1898 it was stated that

"There is no OpenGL support for MacOS with Cocoa. Only win32, Gtk and Qt"

This statement implies that OpenGL is supported if using Qt and NOT Cocoa.

However, in the latest CMakeLists.txt, the option to compile WITH_OPENGL is disabled on APPLE (i.e. mac).


OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )

If Vladislav Vinogradov did mean that OpenGL is supported if using Qt then can someone please update the building process for OpenCV so that there a way for OpenCV to be build on OS X with QT AND with OpenGL support?

Not having OpenGL support on Mac is pretty disabling and means that the sample code in Chapter 3 of the Mastering OpenCV book does not work. See https://github.com/MasteringOpenCV/code/issues/8


History

Updated by Alexander Shishkov about 11 years ago

  • Target version set to 3.0
  • Category set to highgui-gui

Updated by Oliver Wilkie about 11 years ago

FYI apparently "the person who enabled OpenGL interop in OpenCV didn't have access to Mac, so he disabled this option for MacOS until somebody else (from Itseez or from community) adds this support."

Updated by Oliver Wilkie about 11 years ago

I can confirm I have been able to build with OpenGL support and QT5 support on Mac OS X Mavericks. One minor adjustment was required to gl_core see https://github.com/oliw/opencv/commit/c1a653793854c5efbfa109ca6081a61b51a883f4 . Unsure how to proceed next though because I'm not sure how to adjust the root CMakeLists file to allow OpenGL Support only if not building with Cocoa?

Updated by Vladislav Vinogradov about 11 years ago

Hello, Oliver Wilkie!

We would be very appreciated, if you test OpenGL support on Mac and submit pull request with required changes as described in http://code.opencv.org/projects/opencv/wiki/How_to_contribute.

Regarding to your question about modifications in the root CMakeLists file, I guess that it will be enough to remove NOT APPLE from this line:

OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID AND NOT APPLE) )
# replace with
OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF IF (NOT ANDROID) )

OpenGL libraries are set in cmake/OpenCVFindLibsGUI.cmake file only for WIN32UI, Qt and GTK case. So OpenGL support will not be used for Cocoa framework.

  • Assignee changed from Vladislav Vinogradov to Oliver Wilkie

Updated by Anna Kogan about 11 years ago

  • Status changed from New to Open

Updated by Ilya Lavrenov about 11 years ago

Hi Oliver,
The problems was investigated and solved in PR https://github.com/Itseez/opencv/pull/2329. So now OpenGL is enabled on MacOSX.

  • Status changed from Open to Done
  • Assignee changed from Oliver Wilkie to Ilya Lavrenov
  • HW Platform changed from x64 to Any
  • Pull request set to https://github.com/Itseez/opencv/pull/2329
  • Difficulty set to Medium
  • % Done changed from 0 to 100

Also available in: Atom PDF