diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-07-18 17:56:45 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-07-18 17:56:45 (GMT) |
commit | b5f656e0de6e39f0fd935203e0ef2b4231af733d (patch) | |
tree | 8b58020cca8fef8af4df6ae631fddf49e3230049 /Modules/FindJPEG.cmake | |
parent | e118a62709fdc84e6c5b5b8d0bb055895d206ec9 (diff) | |
download | CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.zip CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.tar.gz CMake-b5f656e0de6e39f0fd935203e0ef2b4231af733d.tar.bz2 |
ENH: use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS in some of the FindXXX
modules, remove some of the extra search paths which are also searched by
default
Alex
Diffstat (limited to 'Modules/FindJPEG.cmake')
-rw-r--r-- | Modules/FindJPEG.cmake | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index 3397817..2fd5f0e 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -7,40 +7,22 @@ # also defined, but not for general use are # JPEG_LIBRARY, where to find the JPEG library. -FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h -/usr/local/include -/usr/include -) +FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h) SET(JPEG_NAMES ${JPEG_NAMES} jpeg) -FIND_LIBRARY(JPEG_LIBRARY - NAMES ${JPEG_NAMES} - PATHS /usr/lib /usr/local/lib - ) - -IF (JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - SET(JPEG_LIBRARIES ${JPEG_LIBRARY}) - SET(JPEG_FOUND "YES") -ELSE (JPEG_LIBRARY AND JPEG_INCLUDE_DIR) - SET(JPEG_FOUND "NO") -ENDIF (JPEG_LIBRARY AND JPEG_INCLUDE_DIR) +FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} ) +# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG JPEG_LIBRARY JPEG_INCLUDE_DIR) -IF (JPEG_FOUND) - IF (NOT JPEG_FIND_QUIETLY) - MESSAGE(STATUS "Found JPEG: ${JPEG_LIBRARIES}") - ENDIF (NOT JPEG_FIND_QUIETLY) -ELSE (JPEG_FOUND) - IF (JPEG_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find JPEG library") - ENDIF (JPEG_FIND_REQUIRED) -ENDIF (JPEG_FOUND) +IF(JPEG_FOUND) + SET(JPEG_LIBRARIES ${JPEG_LIBRARY}) +ENDIF(JPEG_FOUND) # Deprecated declarations. SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} ) GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH) -MARK_AS_ADVANCED( - JPEG_LIBRARY - JPEG_INCLUDE_DIR - ) +MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR ) |