diff options
Diffstat (limited to 'Modules/FindFLTK2.cmake')
-rw-r--r-- | Modules/FindFLTK2.cmake | 77 |
1 files changed, 34 insertions, 43 deletions
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index a43e5ff27..a43f7a475 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -1,29 +1,30 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#.rst: -# FindFLTK2 -# --------- -# -# Find the native FLTK2 includes and library -# -# The following settings are defined -# -# :: -# -# FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool -# FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command -# FLTK2_INCLUDE_DIR, where to find include files -# FLTK2_LIBRARIES, list of fltk2 libraries -# FLTK2_FOUND, Don't use FLTK2 if false. -# -# The following settings should not be used in general. -# -# :: -# -# FLTK2_BASE_LIBRARY = the full path to fltk2.lib -# FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib -# FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib +#[=======================================================================[.rst: +FindFLTK2 +--------- + +Find the native FLTK 2.0 includes and library + +The following settings are defined + +:: + + FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool + FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command + FLTK2_INCLUDE_DIR, where to find include files + FLTK2_LIBRARIES, list of fltk2 libraries + FLTK2_FOUND, Don't use FLTK2 if false. + +The following settings should not be used in general. + +:: + + FLTK2_BASE_LIBRARY = the full path to fltk2.lib + FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib + FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib +#]=======================================================================] set (FLTK2_DIR $ENV{FLTK2_DIR} ) @@ -80,11 +81,11 @@ if(NOT FLTK2_DIR) # Look in places relative to the system executable search path. ${FLTK2_DIR_SEARCH} - # Look in standard UNIX install locations. - /usr/local/lib/fltk2 - /usr/lib/fltk2 - /usr/local/fltk2 - /usr/X11R6/include + PATH_SUFFIXES + fltk2 + fltk2/include + lib/fltk2 + lib/fltk2/include # Help the user find it if we cannot. DOC "The ${FLTK2_DIR_STRING}" @@ -175,25 +176,16 @@ if(FLTK2_DIR) set(FLTK2_WRAP_UI 1) endif() - set(FLTK2_INCLUDE_SEARCH_PATH ${FLTK2_INCLUDE_SEARCH_PATH} - /usr/local/fltk2 - /usr/X11R6/include - ) + find_path(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH} PATH_SUFFIXES fltk2 fltk2/include) - find_path(FLTK2_INCLUDE_DIR fltk/run.h ${FLTK2_INCLUDE_SEARCH_PATH}) - - set(FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_LIBRARY_SEARCH_PATH} - /usr/local/fltk2/lib - /usr/X11R6/lib - ${FLTK2_INCLUDE_DIR}/lib - ) + list(APPEND FLTK2_LIBRARY_SEARCH_PATH ${FLTK2_INCLUDE_DIR}/lib) find_library(FLTK2_BASE_LIBRARY NAMES fltk2 - PATHS ${FLTK2_LIBRARY_SEARCH_PATH}) + PATHS ${FLTK2_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk2 fltk2/lib) find_library(FLTK2_GL_LIBRARY NAMES fltk2_gl - PATHS ${FLTK2_LIBRARY_SEARCH_PATH}) + PATHS ${FLTK2_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk2 fltk2/lib) find_library(FLTK2_IMAGES_LIBRARY NAMES fltk2_images - PATHS ${FLTK2_LIBRARY_SEARCH_PATH}) + PATHS ${FLTK2_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk2 fltk2/lib) # Find the extra libraries needed for the fltk_images library. if(UNIX) @@ -251,4 +243,3 @@ else() endif() endif() endif() - |