title: Build OpenCV with OpenCL Enabled and ON
body: <p>I'm trying to run simple code with OpenCL enabled on OpenCV. </p>
  
  <p>I've read the intro to OCL documentation and, as instructed, I built opencv with this flag: WITH_OPENCL=ON. </p>
  
  <p>I did this by doing cmake -DWITH_OPENCL=ON and then built opencv on Mac (OS X Yosemite).</p>
  
  <p>I then tried to run my code, but, according to my code, haveOpenCL() is false. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;iterator&gt;
  #include &lt;opencv2/opencv.hpp&gt;
  #include &lt;opencv2/core/ocl.hpp&gt;
  
  using namespace std;
  
  int  main ()
  {
          cv::ocl::setUseOpenCL(true);
          cout &lt;&lt; cv::ocl::haveOpenCL() &lt;&lt; endl;
          if  ( ! cv::ocl::haveOpenCL ())
          {
                  cout  &lt;&lt;  "OpenCL IS not avaiable ..."  &lt;&lt;  endl ;
                  return 0;
          }
  </code></pre>
  
  <p>Does anybody know how to get OpenCV-OpenCL up and running?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I checked my cvconfig.h file in opencv/build and this is what it says about OpenCL:
      /* OpenCL Support <em>/
      /</em> #undef HAVE_OPENCL <em>/
      /</em> #undef HAVE_OPENCL_STATIC <em>/
      /</em> #undef HAVE_OPENCL_SVM */</p>
  
  <p>I'm assuming that if OpenCL is really enabled, then the second line should be something like
      #define HAVE_OPENCL 1</p>
  
  <p>This is auto-generated, so how can I fix this so that HAVE_OPENCL is 1? </p>