blob: 66b855110cc7cd067744e050c91b4a4570a001e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# - Find JPEG library
# Find the native JPEG includes and library
# This module defines
# JPEG_INCLUDE_DIRS, where to find jpeg.h, Set when
# JPEG is found.
# JPEG_LIBRARIES, libraries to link against to use JPEG.
# JPEG_ROOT_DIR, The base directory to search for JPEG.
# This can also be an environment variable.
# JPEG_FOUND, If false, do not try to use JPEG.
#
# also defined, but not for general use are
# JPEG_LIBRARY, where to find the JPEG library.
#=============================================================================
# Copyright 2018 Martin Felke
#
# 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.
#=============================================================================
# If JPEG_ROOT_DIR was defined in the environment, use it.
IF(NOT JPEG_ROOT_DIR AND NOT $ENV{JPEG_ROOT_DIR} STREQUAL "")
SET(JPEG_ROOT_DIR $ENV{JPEG_ROOT_DIR})
ENDIF()
SET(_jpeg_SEARCH_DIRS
${JPEG_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/lib/jpeg
)
FIND_PATH(JPEG_INCLUDE_DIR
NAMES
jpeglib.h
HINTS
${_jpeg_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(JPEG_LIBRARY
NAMES
jpeg
HINTS
${_jpeg_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# 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 DEFAULT_MSG
JPEG_LIBRARY JPEG_INCLUDE_DIR)
IF(JPEG_FOUND)
SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
SET(JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR})
ELSE()
SET(JPEG_JPEG_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
JPEG_INCLUDE_DIR
JPEG_LIBRARY
)
|