summaryrefslogtreecommitdiffstats
path: root/Modules/FindJPEG.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-05-11 22:32:40 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2006-05-11 22:32:40 (GMT)
commit60988dd8a2addd6358eeac691a0cb43090299633 (patch)
tree0692c16c757fcc61845323f3e87bf66daa65a603 /Modules/FindJPEG.cmake
parent97fcff2445f0caf89394e2f0060fa01f4161d8c1 (diff)
downloadCMake-60988dd8a2addd6358eeac691a0cb43090299633.zip
CMake-60988dd8a2addd6358eeac691a0cb43090299633.tar.gz
CMake-60988dd8a2addd6358eeac691a0cb43090299633.tar.bz2
ENH: honor REQUIRED flag
Alex
Diffstat (limited to 'Modules/FindJPEG.cmake')
-rw-r--r--Modules/FindJPEG.cmake23
1 files changed, 17 insertions, 6 deletions
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index c403fb6..3397817 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)
- SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
- SET(JPEG_FOUND "YES")
- ENDIF (JPEG_INCLUDE_DIR)
-ENDIF (JPEG_LIBRARY)
+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)
+
+
+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} )