title: Add OpenGL support to a previously built OpenCV build
body: <p>I'm trying to improve the performance of my code by replacing</p>
  
  <pre><code>cv::namedWindow("Display frame", WINDOW_NORMAL);
  </code></pre>
  
  <p>with</p>
  
  <pre><code>cv::namedWindow("Display frame", WINDOW_OPENGL);
  </code></pre>
  
  <p>I get the following error after making that change:</p>
  
  <pre><code>No OpenGL support (Library was built without OpenGL support) in cvNamedWindow, file C:\tmp\opencv32\sources\modules\highgui\src\window_w32.cpp, line 764
  </code></pre>
  
  <p>So now I know that my OpenCV build doesn't support OpenGL. I've seen numerous solutions of how to build OpenCV with OpenGL support. But I don't want to rebuild OpenCV because it's part of a bigger SDK I'm using and the configuration options for the current build are very specific. It would be much easier for me to just somehow add the support for OpenGL to the current build. Is this possible, and how?</p>
  
  <p>UPDATE: I looked at the CMakeLists.txt files that were used to build the top level SDK. The CMakeLists.txt file for the openCV folder that came with the SDK looks like this:</p>
  
  <pre><code># Add target for OpenCV
  add_library(OpenCV INTERFACE)
  target_include_directories(OpenCV INTERFACE opencv-3.2/include)
  set(OPENCV_LIB ${CMAKE_CURRENT_SOURCE_DIR}/opencv-3.2/library)
  target_link_libraries(OpenCV INTERFACE
      ${OPENCV_LIB}/opencv_core320.lib
      ${OPENCV_LIB}/opencv_highgui320.lib
      ${OPENCV_LIB}/opencv_imgcodecs320.lib
      ${OPENCV_LIB}/opencv_imgproc320.lib)
  file(GLOB OPENCV_DLL "opencv-3.2/binary/*.dll")
  file(COPY ${OPENCV_DLL} DESTINATION ${CMAKE_BINARY_DIR}/Release)
  </code></pre>
  
  <p>I'm not too familiar with CMake, so please correct me if I'm wrong, but I think this means that the prebuilt SDK contains already built openCV and the CMakeLists.txt is simply adding the already built openCV library to the final SDK build. Now, with this information, is there a way to add openGL support?</p>