From ac739a2e6aeb5fa32f3d81900cc02a4a0ef9a53b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 4 Jun 2007 13:45:58 +0000 Subject: [PATCH] Added local FindFLTK.cmake to avoid problems with FLTK no being found by standard CMake FindFLTK.cmake. --- CMakeModules/FindFLTK.cmake | 60 +++++++++++++++++++++++++++ examples/osgviewerFLTK/CMakeLists.txt | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 CMakeModules/FindFLTK.cmake diff --git a/CMakeModules/FindFLTK.cmake b/CMakeModules/FindFLTK.cmake new file mode 100644 index 000000000..ca843cb3a --- /dev/null +++ b/CMakeModules/FindFLTK.cmake @@ -0,0 +1,60 @@ +# Locate gdal +# This module defines +# FLTK_LIBRARY +# FLTK_FOUND, if false, do not try to link to gdal +# FLTK_INCLUDE_DIR, where to find the headers +# +# $FLTK_DIR is an environment variable that would +# correspond to the ./configure --prefix=$FLTK_DIR +# +# Created by Robert Osfield. + +FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h + $ENV{FLTK_DIR}/include + $ENV{FLTK_DIR} + $ENV{OSGDIR}/include + $ENV{OSGDIR} + $ENV{OSG_ROOT}/include + ~/Library/Frameworks + /Library/Frameworks + /usr/local/include + /usr/include + /sw/include # Fink + /opt/local/include # DarwinPorts + /opt/csw/include # Blastwave + /opt/include + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include + /usr/freeware/include +) + +MACRO(FIND_FLTK_LIBRARY MYLIBRARY MYLIBRARYNAME) + + FIND_LIBRARY(${MYLIBRARY} + NAMES ${MYLIBRARYNAME} + PATHS + $ENV{FLTK_DIR}/lib + $ENV{FLTK_DIR} + $ENV{OSGDIR}/lib + $ENV{OSGDIR} + $ENV{OSG_ROOT}/lib + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib + /usr/freeware/lib64 + ) + +ENDMACRO(FIND_FLTK_LIBRARY LIBRARY LIBRARYNAME) + +FIND_FLTK_LIBRARY(FLTK_LIBRARY fltk) +FIND_FLTK_LIBRARY(FLTK_GL_LIBRARY fltk_gl) + +SET(FLTK_FOUND "NO") +IF(FLTK_LIBRARY AND FLTK_INCLUDE_DIR) + SET(FLTK_FOUND "YES") +ENDIF(FLTK_LIBRARY AND FLTK_INCLUDE_DIR) diff --git a/examples/osgviewerFLTK/CMakeLists.txt b/examples/osgviewerFLTK/CMakeLists.txt index 86ea10db8..43c023b89 100644 --- a/examples/osgviewerFLTK/CMakeLists.txt +++ b/examples/osgviewerFLTK/CMakeLists.txt @@ -1,6 +1,6 @@ SET(TARGET_SRC osgviewerFLTK.cpp ) -SET(TARGET_EXTERNAL_LIBRARIES ${FLTK_LIBRARIES} ) +SET(TARGET_EXTERNAL_LIBRARIES ${FLTK_LIBRARY} ${FLTK_GL_LIBRARY}) INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR} )