[CMake] Finding FLTK?

Brandon Van Every bvanevery at gmail.com
Wed Aug 1 16:21:53 EDT 2007


On 8/1/07, Christian Convey <christian.convey at gmail.com> wrote:
> I'm using FindFLTK, and I seem to need to specify, on my own:
>     FLTK_INCLUDE_DIR=/usr/include/FL
>
> If I don't set it explicitly, then the variable FLTK_FOUND ends up
> having a value of 0 rather than 1.

It looks like this section is checking for the availability of a bunch
of different components.  Do you have all of these listed things
installed correctly?  Can you verify that outside of CMake?

SET(FLTK_FOUND 1)
FOREACH(var FLTK_FLUID_EXECUTABLE FLTK_INCLUDE_DIR
    FLTK_BASE_LIBRARY FLTK_GL_LIBRARY
    FLTK_FORMS_LIBRARY FLTK_IMAGES_LIBRARY)
  IF(NOT ${var})
    SET(FLTK_FOUND 0)
  ENDIF(NOT ${var})
ENDFOREACH(var)

> Does anyone know why this is?  When I look through the shipped version
> of FindFLTK.cmake, line 179 appears to specifically indicate that the
> module author expected FLTK's header files to reside in a "FL"
> subdirectory:

Yep, you're expected to have statements like #include <Fl/Fl.H> in your code.

I found the following comment when Googling around about the issue:
http://cartwheel.idyll.org/browser/trunk/FRII/CMakeLists.txt

So CMake's FindFLTK only looks for FL/Fl.h and FLTK decided that
they like .H better, so it couldn't find FLTK. I replaced the
check with a simpler search for the header file.

My current solution doesn't provide a good way of allowing the user
to specify the location of FLTK.

Reported to Kitware as:
http://www.cmake.org/Bug/bug.php?op=show&bugid=4424

Cheers,
Brandon Van Every


More information about the CMake mailing list