2 # Find the native FLTK includes and library
4 # The following settings are defined
5 # FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
6 # FLTK_INCLUDE_DIR, where to find include files
7 # FLTK_LIBRARIES, list of fltk libraries
8 # FLTK_VERSION_1.0.11 Use this Version
9 # FLTK_VERSION_1.1 Use this Version
10 # FLTK_FOUND, Don't use FLTK if false.
12 # this is around for backwards compatibility
13 # FLTK_WRAP_UI set to true if FLTK_FLUID_EXECUTABLE is found
17 # The following settings should not be used in general.
18 # FLTK_BASE_LIBRARY = the full path to fltk.lib
19 # FLTK_GL_LIBRARY = the full path to fltk_gl.lib
20 # FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
21 # FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
23 OPTION(FLTK_VERSION_1.1 "Use FLTK version 1.1" 1)
24 OPTION(FLTK_VERSION_1.0.11 "Use FLTK version 1.0.11" 0)
26 # Exclusion between the two version
29 SET(FLTK_VERSION_1.0.11 0)
30 ENDIF(FLTK_VERSION_1.1)
32 # look for both Fl.h and Fl.H
33 FIND_PATH(FLTK_INCLUDE_DIR FL/Fl.h
40 FIND_PATH(FLTK_INCLUDE_DIR FL/Fl.H
47 # Platform dependent libraries required by FLTK
52 SET( FLTK_PLATFORM_DEPENDENT_LIBS import32 )
54 SET( FLTK_PLATFORM_DEPENDENT_LIBS wsock32 comctl32 )
61 SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
65 SET( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
68 # Make sure that the FLTK include path has been set
69 # So the FLTK_LIBRARY does not appear the first time
71 IF(FLTK_VERSION_1.0.11)
72 FIND_LIBRARY(FLTK_BASE_LIBRARY NAMES fltk fltkd
73 PATHS /usr/lib /usr/local/lib
76 /usr/X11R6/lib ${FLTK_INCLUDE_DIR}/lib
78 ENDIF(FLTK_VERSION_1.0.11)
80 FIND_LIBRARY(FLTK_BASE_LIBRARY NAMES fltk fltkd
81 PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib
82 /usr/X11R6/lib ${FLTK_INCLUDE_DIR}/lib
84 FIND_LIBRARY(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
85 PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib
86 /usr/X11R6/lib ${FLTK_INCLUDE_DIR}/lib
88 FIND_LIBRARY(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
89 PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib
90 /usr/X11R6/lib ${FLTK_INCLUDE_DIR}/lib
92 FIND_LIBRARY(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
93 PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib
94 /usr/X11R6/lib ${FLTK_INCLUDE_DIR}/lib
96 ENDIF(FLTK_VERSION_1.1)
100 ${FLTK_IMAGES_LIBRARY}
102 ${FLTK_PLATFORM_DEPENDENT_LIBS}
104 ENDIF(FLTK_INCLUDE_DIR)
106 FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid
107 ${path} ${FLTK_INCLUDE_DIR}/fluid
112 # This is the final flag that will be checked by
113 # other code that requires FLTK for compile/run.
116 IF(FLTK_FLUID_EXECUTABLE)
120 # The fact that it is in the cache is deprecated.
121 SET (FLTK_FOUND 1 CACHE INTERNAL "FLTK library, headers and Fluid are available")
123 # The following deprecated settings are for compatibility with CMake 1.4
124 SET (HAS_FLTK ${FLTK_FOUND})
125 SET (FLTK_INCLUDE_PATH ${FLTK_INCLUDE_DIR})
126 SET (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
127 SET (FLTK_LIBRARY ${FLTK_LIBRARIES})
128 ENDIF(FLTK_LIBRARIES)
129 ENDIF(FLTK_INCLUDE_DIR)
130 ENDIF(FLTK_FLUID_EXECUTABLE)
133 IF (FLTK_FLUID_EXECUTABLE)
134 SET ( FLTK_WRAP_UI 1 CACHE INTERNAL "Do we have the fluid executable" )
135 ENDIF (FLTK_FLUID_EXECUTABLE)