diff options
author | Luis Ibanez <luis.ibanez@kitware.com> | 2002-06-06 19:28:28 (GMT) |
---|---|---|
committer | Luis Ibanez <luis.ibanez@kitware.com> | 2002-06-06 19:28:28 (GMT) |
commit | 2deb001881976a067c775c9934283bd2cf9a3f3f (patch) | |
tree | 0f7629fa0589559aaa0852e71686a785a7404d45 /Modules/FindFLTK.cmake | |
parent | 8f8b4375bdabec009090813ef36bc2109015ae5c (diff) | |
download | CMake-2deb001881976a067c775c9934283bd2cf9a3f3f.zip CMake-2deb001881976a067c775c9934283bd2cf9a3f3f.tar.gz CMake-2deb001881976a067c775c9934283bd2cf9a3f3f.tar.bz2 |
ENH: Support for FLTK1.1 and FLTK1.0.11 added. An option allows to select
between the two versions.
Diffstat (limited to 'Modules/FindFLTK.cmake')
-rw-r--r-- | Modules/FindFLTK.cmake | 133 |
1 files changed, 91 insertions, 42 deletions
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index 812ec42..076ec3b 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -1,42 +1,91 @@ -# -# Find the native FLTK includes and library -# -# FLTK_FLUID_EXE, where to find the Fluid tool -# FLTK_WRAP_UI, This allows the FLTK_WRAP_UI command to work. - - -FIND_PATH(FLTK_INCLUDE_PATH FL/Fl.h -/usr/local/include -/usr/include -/usr/local/fltk -/usr/X11R6/include -H:/usr/local/fltk -) - -FIND_LIBRARY(FLTK_LIBRARY fltk -PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib -) - -FIND_FILE(FLTK_FLUID_EXE fluid -${path} -) - -IF (FLTK_FLUID_EXE) - SET ( FLTK_WRAP_UI 1 CACHE INTERNAL "Can we honour the FLTK_WRAP_UI command" ) -ENDIF (FLTK_FLUID_EXE) - - -# -# Set HAS_FLTK -# This is the final flag that will be checked by -# other code that requires FLTK for compile/run. -# -IF(FLTK_FLUID_EXE) - IF(FLTK_INCLUDE_PATH) - IF(FLTK_LIBRARY) - SET (HAS_FLTK 1 CACHE INTERNAL "FLTK library, headers and Fluid are available") - ENDIF(FLTK_LIBRARY) - ENDIF(FLTK_INCLUDE_PATH) -ENDIF(FLTK_FLUID_EXE) - - +#
+# Find the native FLTK includes and library
+#
+# FLTK_FLUID_EXE, where to find the Fluid tool
+# FLTK_WRAP_UI, This allows the FLTK_WRAP_UI command to work.
+# FLTK_INCLUDE_PATH, where to find include files
+# FLTK_LIBRARY, list of fltk libraries
+# FLTK_BASE_LIBRARY, the full path to fltk.lib
+# FLTK_GL_LIBRARY, the full path to fltk_gl.lib
+# FLTK_FORMS_LIBRARY, the full path to fltk_forms.lib
+
+
+OPTION(USE_FLTK_VERSION_1.0.11 "Use FLTK version 1.0.11" 1)
+
+OPTION(USE_FLTK_VERSION_1.1 "Use FLTK version 1.1" 0)
+
+# Exlusion between the two version
+IF(USE_FLTK_VERSION_1.0.11)
+ SET(USE_FLTK_VERSION_1.1 0)
+ENDIF(USE_FLTK_VERSION_1.0.11)
+
+
+FIND_PATH(FLTK_INCLUDE_PATH FL/Fl.h
+/usr/local/include
+/usr/include
+/usr/local/fltk
+/usr/X11R6/include
+H:/usr/local/fltk
+)
+
+# Make sure that the FLTK include path has been set
+# So the FLTK_LIBRARY does not appear the first time
+IF(FLTK_INCLUDE_PATH)
+ IF(USE_FLTK_VERSION_1.0.11)
+ FIND_LIBRARY(FLTK_BASE_LIBRARY fltk
+ PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib
+ ${FLTK_INCLUDE_PATH}/lib
+ )
+ ENDIF(USE_FLTK_VERSION_1.0.11)
+
+
+ IF(USE_FLTK_VERSION_1.1)
+ FIND_LIBRARY(FLTK_BASE_LIBRARY fltk
+ PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib
+ ${FLTK_INCLUDE_PATH}/lib
+ )
+ FIND_LIBRARY(FLTK_GL_LIBRARY fltkgl
+ PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib
+ ${FLTK_INCLUDE_PATH}/lib
+ )
+ FIND_LIBRARY(FLTK_FORMS_LIBRARY fltkforms
+ PATHS /usr/lib /usr/local/lib /usr/local/fltk/lib H:/usr/local/fltk/lib /usr/X11R6/lib
+ ${FLTK_INCLUDE_PATH}/lib
+ )
+ ENDIF(USE_FLTK_VERSION_1.1)
+
+ SET( FLTK_LIBRARY $FLTK_BASE_LIBRARY $FLTK_GL_LIBRARY $FLTK_FORMS_LIBRARY )
+
+ENDIF(FLTK_INCLUDE_PATH)
+
+# Find Fluid
+FIND_FILE(FLTK_FLUID_EXE fluid
+${path} ${FLTK_INCLUDE_PATH}/fluid
+)
+
+# Enable the Wrap UI command
+IF (FLTK_FLUID_EXE)
+ SET ( FLTK_WRAP_UI 1 CACHE INTERNAL "Can we honour the FLTK_WRAP_UI command" )
+ENDIF (FLTK_FLUID_EXE)
+
+#
+# Set HAS_FLTK
+# This is the final flag that will be checked by
+# other code that requires FLTK for compile/run.
+#
+IF(FLTK_FLUID_EXE)
+ IF(FLTK_INCLUDE_PATH)
+ IF(USE_FLTK_VERSION_1.0.11)
+ IF(FLTK_LIBRARY)
+ SET (HAS_FLTK 1 CACHE INTERNAL "FLTK library, headers and Fluid are available")
+ ENDIF(FLTK_LIBRARY)
+ ENDIF(USE_FLTK_VERSION_1.0.11)
+ IF(USE_FLTK_VERSION_1.1)
+ IF(FLTK_LIBRARY_PATH)
+ SET (HAS_FLTK 1 CACHE INTERNAL "FLTK library, headers and Fluid are available")
+ ENDIF(FLTK_LIBRARY_PATH)
+ ENDIF(USE_FLTK_VERSION_1.1)
+ ENDIF(FLTK_INCLUDE_PATH)
+ENDIF(FLTK_FLUID_EXE)
+
+
|