ENH: clean the module, add debug libs
[cmake.git] / Modules / FindFLTK.cmake
blob3f5362c618c4653fd8cd751f4a4f52032321e39b
1 #\r
2 # Find the native FLTK includes and library\r
3 #\r
4 # FLTK_FLUID_EXE, where to find the Fluid tool\r
5 # FLTK_WRAP_UI, This allows the FLTK_WRAP_UI command to work.\r
6 # FLTK_INCLUDE_PATH, where to find include files\r
7 # FLTK_LIBRARY, list of fltk libraries\r
8 # FLTK_BASE_LIBRARY, the full path to fltk.lib\r
9 # FLTK_GL_LIBRARY, the full path to fltk_gl.lib\r
10 # FLTK_FORMS_LIBRARY, the full path to fltk_forms.lib\r
13 OPTION(USE_FLTK_VERSION_1.0.11 "Use FLTK version 1.0.11" 1)\r
15 OPTION(USE_FLTK_VERSION_1.1 "Use FLTK version 1.1" 0)\r
17 # Exlusion between the two version\r
18 IF(USE_FLTK_VERSION_1.0.11)\r
19   SET(USE_FLTK_VERSION_1.1 0)\r
20 ENDIF(USE_FLTK_VERSION_1.0.11)\r
23 FIND_PATH(FLTK_INCLUDE_PATH FL/Fl.h\r
24 /usr/local/include\r
25 /usr/include\r
26 /usr/local/fltk\r
27 /usr/X11R6/include\r
28 H:/usr/local/fltk\r
29 )\r
31 # Make sure that the FLTK include path has been set\r
32 # So the FLTK_LIBRARY does not appear the first time\r
33 IF(FLTK_INCLUDE_PATH)\r
34   IF(USE_FLTK_VERSION_1.0.11)\r
35     FIND_LIBRARY(FLTK_BASE_LIBRARY  fltk\r
36      PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib\r
37        ${FLTK_INCLUDE_PATH}/lib\r
38     )\r
39   ENDIF(USE_FLTK_VERSION_1.0.11)\r
42   IF(USE_FLTK_VERSION_1.1)\r
43     FIND_LIBRARY(FLTK_BASE_LIBRARY  fltk\r
44      PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib\r
45            ${FLTK_INCLUDE_PATH}/lib\r
46     )\r
47    FIND_LIBRARY(FLTK_GL_LIBRARY fltkgl\r
48      PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib\r
49            ${FLTK_INCLUDE_PATH}/lib\r
50     )\r
51    FIND_LIBRARY(FLTK_FORMS_LIBRARY fltkforms\r
52      PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib\r
53            ${FLTK_INCLUDE_PATH}/lib\r
54     )\r
55   ENDIF(USE_FLTK_VERSION_1.1)\r
57   SET( FLTK_LIBRARY ${FLTK_BASE_LIBRARY} ${FLTK_GL_LIBRARY} ${FLTK_FORMS_LIBRARY} )\r
59 ENDIF(FLTK_INCLUDE_PATH)\r
61 # Find Fluid\r
62 FIND_FILE(FLTK_FLUID_EXE fluid\r
63 ${path} ${FLTK_INCLUDE_PATH}/fluid\r
64 )\r
66 # Enable the Wrap UI command\r
67 IF (FLTK_FLUID_EXE)\r
68   SET ( FLTK_WRAP_UI 1 CACHE INTERNAL "Can we honour the FLTK_WRAP_UI command" )\r
69 ENDIF (FLTK_FLUID_EXE)\r
71 #\r
72 #  Set HAS_FLTK\r
73 #  This is the final flag that will be checked by\r
74 #  other code that requires FLTK for compile/run.\r
75 #\r
76 IF(FLTK_FLUID_EXE)\r
77   IF(FLTK_INCLUDE_PATH)\r
78     IF(FLTK_LIBRARY)\r
79       SET (HAS_FLTK 1 CACHE INTERNAL "FLTK library, headers and Fluid are available")\r
80     ENDIF(FLTK_LIBRARY)\r
81   ENDIF(FLTK_INCLUDE_PATH)\r
82 ENDIF(FLTK_FLUID_EXE)\r