summaryrefslogtreecommitdiffstats
path: root/Modules/FindFLTK.cmake
diff options
context:
space:
mode:
authorChristian Pfeiffer <cpfeiffer@live.de>2017-11-20 15:29:25 (GMT)
committerChristian Pfeiffer <cpfeiffer@live.de>2017-11-20 15:29:25 (GMT)
commita62d50ec56087bc6364c2e6c097b312167839957 (patch)
treeccd039133f878c223a4debd63e5b369ab87dc214 /Modules/FindFLTK.cmake
parentfd56d6a8e637750cbf2e038bde12164962c66bc4 (diff)
downloadCMake-a62d50ec56087bc6364c2e6c097b312167839957.zip
CMake-a62d50ec56087bc6364c2e6c097b312167839957.tar.gz
CMake-a62d50ec56087bc6364c2e6c097b312167839957.tar.bz2
Modules: Replace coded PATHS with PATH_SUFFIXES
Some modules assume that `/usr` and `/usr/local` are the only `CMAKE_PREFIX_PATH` entries and explicitly enumerate all paths instead of using `PATH_SUFFIXES` and relying on the dynamic set of prefix paths. This commit attempts to rectify that behavior.
Diffstat (limited to 'Modules/FindFLTK.cmake')
-rw-r--r--Modules/FindFLTK.cmake33
1 files changed, 12 insertions, 21 deletions
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index e6bd3c9..1aa52cc 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -114,12 +114,11 @@ if(NOT FLTK_DIR)
# Look in places relative to the system executable search path.
${FLTK_DIR_SEARCH}
- PATHS
- # Look in standard UNIX install locations.
- /usr/local/lib/fltk
- /usr/lib/fltk
- /usr/local/fltk
- /usr/X11R6/include
+ PATH_SUFFIXES
+ fltk
+ fltk/include
+ lib/fltk
+ lib/fltk/include
# Help the user find it if we cannot.
DOC "The ${FLTK_DIR_STRING}"
@@ -216,14 +215,11 @@ endif()
endif()
endif()
- set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
- /usr/local/fltk
- /usr/X11R6/include
- ${_FLTK_POSSIBLE_INCLUDE_DIRS}
- )
+ list(APPEND FLTK_INCLUDE_SEARCH_PATH ${_FLTK_POSSIBLE_INCLUDE_DIRS})
find_path(FLTK_INCLUDE_DIR
NAMES FL/Fl.h FL/Fl.H # fltk 1.1.9 has Fl.H (#8376)
+ PATH_SUFFIXES fltk fltk/include
PATHS ${FLTK_INCLUDE_SEARCH_PATH})
#
@@ -237,21 +233,16 @@ endif()
endif()
endif()
- set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
- /usr/local/fltk/lib
- /usr/X11R6/lib
- ${FLTK_INCLUDE_DIR}/lib
- ${_FLTK_POSSIBLE_LIBRARY_DIR}
- )
+ list(APPEND FLTK_LIBRARY_SEARCH_PATH ${FLTK_INCLUDE_DIR}/lib ${_FLTK_POSSIBLE_LIBRARY_DIR})
find_library(FLTK_BASE_LIBRARY NAMES fltk fltkd
- PATHS ${FLTK_LIBRARY_SEARCH_PATH})
+ PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib)
find_library(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl
- PATHS ${FLTK_LIBRARY_SEARCH_PATH})
+ PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib)
find_library(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms
- PATHS ${FLTK_LIBRARY_SEARCH_PATH})
+ PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib)
find_library(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images
- PATHS ${FLTK_LIBRARY_SEARCH_PATH})
+ PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib)
# Find the extra libraries needed for the fltk_images library.
if(UNIX)