diff options
Diffstat (limited to 'Modules/FindJPEG.cmake')
-rw-r--r-- | Modules/FindJPEG.cmake | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake index c403fb6..b5abc0b 100644 --- a/Modules/FindJPEG.cmake +++ b/Modules/FindJPEG.cmake @@ -18,12 +18,23 @@ FIND_LIBRARY(JPEG_LIBRARY PATHS /usr/lib /usr/local/lib ) -IF (JPEG_LIBRARY) - IF (JPEG_INCLUDE_DIR) +IF (JPEG_LIBRARY AND JPEG_INCLUDE_DIR) SET(JPEG_LIBRARIES ${JPEG_LIBRARY}) SET(JPEG_FOUND "YES") - ENDIF (JPEG_INCLUDE_DIR) -ENDIF (JPEG_LIBRARY) +ELSE (JPEG_LIBRARY AND JPEG_INCLUDE_DIR) + SET(JPEG_FOUND "NO") +ENDIF (JPEG_LIBRARY AND 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) # Deprecated declarations. SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} ) |