[CMake] FLTK issue with cmake

André EBERSOLD andre.ebersold at gmail.com
Sat Jul 6 16:39:53 EDT 2013


I'm facing some problems with FLTK too.

On linux, when you build and install FLTK with cmake, there is a file FLTKConfig.cmake installed in directory <FLTK INSTALL PREFIX>/CMake

When you invoke cmake -D FLTK_DIR=<FLTK_INSTALL PREFIX>/CMake  .  every thing is found properly. (at least for me).

What I don't understand is why in the FindFLTK.cmake file
is there a line that SETS FLTK_INCLUDE_DIR to FLTK_DIR?  
when using the FLTKConfig.cmake file, the proper directory should be ${FLTK_DIR}/../include  that's were the include files are installed. (for FLTK 1.3)



FindFLTK.cmake part
...

IF(FLTK_BUILT_WITH_CMAKE)
    SET(FLTK_FOUND 1)
    INCLUDE(${FLTK_DIR}/FLTKConfig.cmake)

    # Fluid
    IF(FLUID_COMMAND)
      SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
    ELSE(FLUID_COMMAND) 
      FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS 
        ${FLTK_EXECUTABLE_DIRS}
        ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo
        ${FLTK_EXECUTABLE_DIRS}/Debug
        ${FLTK_EXECUTABLE_DIRS}/Release
        NO_SYSTEM_PATH)
    ENDIF(FLUID_COMMAND)
    # MARK_AS_ADVANCED(FLTK_FLUID_EXECUTABLE)

    SET(FLTK_INCLUDE_DIR ${FLTK_DIR})
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^I think this is not correct.
    LINK_DIRECTORIES(${FLTK_LIBRARY_DIRS})

May be someone else can share his thoughts about this subject.

Kind  regards,
Andre E.


Le 6 juil. 2013 à 13:49, moon light a écrit :

> Hi All,
> 
> I'm facing a problem with FLTK and cmake and i found a previous post discusses the same problem but i'm not fully understand how it was solved. what i'm trying to do is to build itk applications so i have to build itk, vtk and fltk first but during itk applications configuration using cmake it gave me the following error below. 
> 
> ITK VERSION: 4.3.1
> VTK VERSION: 5.10.1
> CMake Error at CMakeLists.txt:134 (FIND_PACKAGE):
> Could not find a package configuration file provided by "FLTK" with any of
> the following names:
> FLTKConfig.cmake
> fltk-config.cmake
> Add the installation prefix of "FLTK" to CMAKE_PREFIX_PATH or set
> "FLTK_DIR" to a directory containing one of the above files. If "FLTK"
> provides a separate development package or SDK, be sure it has been
> installed.
> Configuring incomplete, errors occurred!
> 
> 
> The link to the post is (http://www.cmake.org/pipermail/cmake/2010-December/041626.html), but i want to know in which cmake file and which part in the code should i edit or put the following part.
> > SET(FLTK_DIR "C:/Program Files/fltk-1.1.9/")
> > SET(FLTK_BASE_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
> > SET(FLTK_FORMS_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
> > SET(FLTK_GL_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
> > SET(FLTK_IMAGES_LIBRARY "C:/Program Files/fltk-1.1.9/lib/")
> > SET(FLTK_INCLUDE_DIR "C:/Program Files/fltk-1.1.9/include/")
> > SET(FLTK_SKIP_FLUID TRUE)
> > FIND_PACKAGE(FLTK REQUIRED)
> 
> Looking forward for your replies..
> 
> Mai
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130706/b6689744/attachment-0001.htm>


More information about the CMake mailing list