FindJPEG.cmake 1.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#.rst:
# FindJPEG
# --------
#
# Find JPEG
#
# Find the native JPEG includes and library This module defines
#
# ::
#
#   JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
#   JPEG_LIBRARIES, the libraries needed to use JPEG.
#   JPEG_FOUND, If false, do not try to use JPEG.
#
15
# also defined, but not for general use are
16 17 18 19
#
# ::
#
#   JPEG_LIBRARY, where to find the JPEG library.
20

21 22 23 24 25 26 27 28 29 30
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
31
# (To distribute this file outside of CMake, substitute the full
32 33
#  License text for the above reference.)

34
find_path(JPEG_INCLUDE_DIR jpeglib.h)
35

36
set(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg)
37
find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES} )
38

39
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
40
# all listed variables are TRUE
41
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
42
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
43

44 45
if(JPEG_FOUND)
  set(JPEG_LIBRARIES ${JPEG_LIBRARY})
46
endif()
47 48

# Deprecated declarations.
49 50 51
set (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
if(JPEG_LIBRARY)
  get_filename_component (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
52
endif()
Bill Hoffman's avatar
Bill Hoffman committed
53

54
mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )