summaryrefslogtreecommitdiffstats
path: root/Modules/FindJPEG.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindJPEG.cmake')
-rw-r--r--Modules/FindJPEG.cmake38
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 )