kdenlive compilation fails without USE_OPEN_GL

I'm using latest script to build kdenlive from src, and it fails when compiling kdenlive monitor.cpp, line 184.
It seems that latest SVN change on monitor.cpp is the reason (use of m_glWidget that is not initialized in that scope).

Index: monitor.cpp
--- monitor.cpp (révision 5078)
+++ monitor.cpp (révision 5182)
@@ -181,6 +181,9 @@
render = new Render(m_name, (int) m_monitorRefresh->winId(), profile, this);
+ }else if (m_glWidget) {
+ lay->addWidget(m_glWidget);
+ m_videoBox->setLayout(lay);

I suggest to add some #if defined(USE_OPEN_GL)

However, after adding it, it compils, but I still having troubles during linking:
CMakeFiles/kdenlive.dir/blackmagic/capture.o: In function `CDeckLinkGLWidget':
/home/vbarbere/usr/local/kdenlive/src/kdenlive/src/blackmagic/capture.cpp:109: undefined reference to `QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<:windowtype>)'

I'm not very familiar with cmake... Could you help me ?

Hello again.

well, I'm still stuck with this linking failure:
Linking CXX executable kdenlive
CMakeFiles/kdenlive.dir/blackmagic/capture.o: In function `CDeckLinkGLWidget':
capture.cpp:109: undefined reference to `QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<:windowtype>)'
capture.cpp:109: undefined reference to `QGLWidget::QGLWidget(QWidget*, QGLWidget const*, QFlags<:windowtype>)'
CMakeFiles/kdenlive.dir/blackmagic/capture.o: In function `CDeckLinkGLWidget::showOverlay(QImage, bool)':
[....... lot of other similar issues]

I'm using a ubuntu system with all developments packages installed, including libqt4-opengl-dev.

capture.cpp uses QGLWidget, which cannot be simply disabled.
you should setup your kdenlive with opengl, or capture.cpp must use a non opengl way.


How can I setup kdenlive with opengl enabled ?

cmake -DUSE_OPEN_GL=1 should set this.

or take a look in src/CMakeLists.txt


maybe the else should also set the find_package(OpenGL) (since this is not every time needed under linux, this should be configurable)

This does not solve the linking issue (I tried both methods)

To solve it, I had to edit the ./src/cmake_bindir/CMakeFiles/kdenlive.dir/link.txt and I appended the "-lQtOpenGL" flag.

I've look deeper into details into src/CMakeLists.txt and found a workaround by commenting mentioned lines below to force library linking
find_package(SDL REQUIRED)
target_link_libraries(kdenlive ${SDL_LIBRARY})
target_link_libraries(kdenlive ${QT_QTOPENGL_LIBRARY})
target_link_libraries(kdenlive ${OPENGL_LIBRARIES})
# if(OPENGL_FOUND) target_link_libraries(kdenlive ${QT_QTOPENGL_LIBRARY})
target_link_libraries(kdenlive ${OPENGL_LIBRARIES})
# endif(OPENGL_FOUND) endif(APPLE)

So, it seems that "OPENGL_FOUND" is false. What sets this variable ?