[CMake] Re : Where does cmake look for include files?

Marianne B. Wiese mbwiese at gmail.com
Fri Aug 8 16:12:59 EDT 2008


Hi Tonio

There is a paragraph in the CMakelists.txt regarding OpenGL

  FIND_PACKAGE(OpenGL)
  IF(OPENGL_FOUND)
    SET(HAVE_GL 1)
    INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
  ENDIF(OPENGL_FOUND)

and it seems to work, because cmake generates a config.h file with the line:

#define HAVE_GL 1

My problem is, that GL/glu.h (GLU not GLUT) is not found.
I may misinterpret the syntax in cmakelists.txt, but I assume that the line
CHECK_INCLUDE_FILES("GL/glu.h"       HAVE_GL_GLU_H)
will set HAVE_GL_GLU_H to 1 if the file GL/glu.h is found.

In the config.h file cmake writes
/* #undef HAVE_GL_GLU_H */
And I want cmake to recognize that I have the header and lib files, and to
write
HAVE_GL_GLU_H 1

I think, that FLTK's cmakelists.txt file should work, It has been around for
a long time.
And when I Google, I do not see my problem pop up.

Therefore I guess that I make some very basic thing wrong, as I am not used
to use CMake.

Thank you for pointing at *cmakepath*/share/cmake-2.x/Modules. I found the
"CheckIncludeFiles.cmake" there. I was wrong then in my question to state
that this file does not exist, I had looked for it only in the FLTK-sources.

I will have a look at that file, and see if I can figure out what to do.

Marianne
On Fri, Aug 8, 2008 at 1:18 PM, Antoine PREVOT <tonio_lesec at yahoo.fr> wrote:

> > Apparently CMake cannot find the headers for openGL and/or GLU
> > ...
> > I would expect cmake to be smart enough to find the glu
> > header file, since it finds the VCExpress.exe.
>
> Hi Marianne,
>
> Did you do anything to make cm guess that you want to inclulde GLU headers
> ? Dunno the detais of your project, but you should have these few lines
> somewhere :
>
> ******************** somepath/CMakeLists.txt
> ...
> INCLUDE(FindGLUT)
> IF(GLUT_FOUND)
>  #MESSAGE(STATUS  "GLUT found...")
>  #MESSAGE("opengl include directory : ${GLUT_INCLUDE_DIR}")
>  #MESSAGE("opengl library directory : ${GLUT_LIBRARY}")
>  INCLUDE_DIRECTORIES(${GLUT_INCLUDE_DIR}/Headers)
>  LINK_LIBRARIES(${GLUT_LIBRARY})
> ELSE(GLUT_FOUND)
>  MESSAGE(FATAL_ERROR "GLUT not found")
> ENDIF(GLUT_FOUND)
> ...
>
> See *cmakepath*/share/cmake-2.x/Modules/FindGLUT.cmake for more
> informations about the way cmake will search for glut.
>
> Cordially,
>
> Tonio
>
>
>
>
>
>  _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Une boite mail plus intelligente
> http://mail.yahoo.fr
>



-- 
Marianne B. Wiese
Reventlowsgade 30
1651 København V

+45 33 22 69 18
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080808/587505e0/attachment.htm>


More information about the CMake mailing list