Help for Installation with Cmake

Hello,

I would like to compile root with Cmake in order to use it with XCode, however, I am new to CMake and not sure how to fix its errors.

Here is the error I get after trying:

cmake /usr/local/root/src -DCMAKE_INSTALL_PREFIX=/usr/local/root/build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -Droofit=ON
----------------------------------------------------snip------------------------------------------------------------
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /usr/local/root/src/graf3d/eve
used as include directory in directory /usr/local/root/src/graf3d/eve
used as include directory in directory /usr/local/root/src/graf3d/gl
used as include directory in directory /usr/local/root/src/graf3d/gl
used as include directory in directory /usr/local/root/src/graf3d/glew
used as include directory in directory /usr/local/root/src/graf3d/ftgl
----------------------------------------------------snip------------------------------------------------------------

I am using os x 10.8.2 and as pre-requitsite installed:

$ brew install gfortran # Fortran compiler
$ brew install python # Python interpreter
$ brew install pcre # Regular Expressions library
$ brew install fftw # Fast Fourier Transforms
$ brew install cmake

Is there something else I need to install?

Thank you very much,

Dmitry.

I found a solution.

CMake could not find OpenGL headers and libraries, because the version of cmake finders that comes wioth root is outdated for mac OS X 10.8.x It was looking in X11R6 directories, which no longer there.

All X11 stuff is either in /usr/X11 or /opt/X11

Therefore, I had to edit > cmake/modules/FindOpenGL.cmake

and put

/usr/X11/include
  /opt/X11/include

and

        /usr/X11/lib
        /opt/X11/lib

in the places, where I found instances of X11R6

After this root compiles and builds.

Cheers 8) ,

Dmitry