-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindFreeImagePlus.cmake
83 lines (75 loc) · 2.69 KB
/
FindFreeImagePlus.cmake
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
73
74
75
76
77
78
79
80
81
82
83
# Find the FreeImage library.
#
# This module defines
# FREEIMAGE_FOUND - True if FREEIMAGE was found.
# FREEIMAGE_INCLUDE_DIRS - Include directories for FREEIMAGE headers.
# FREEIMAGE_LIBRARIES - Libraries for FREEIMAGE.
#
# To specify an additional directory to search, set FREEIMAGE_ROOT.
#
# Copyright (c) 2010, Ewen Cheslack-Postava
# Based on FindSQLite3.cmake by:
# Copyright (c) 2006, Jaroslaw Staniek, <[email protected]>
# Extended by Siddhartha Chaudhuri, 2008.
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
SET(FREEIMAGEPLUS_FOUND FALSE)
SET(FREEIMAGEPLUS_INCLUDE_DIRS)
SET(FREEIMAGEPLUS_LIBRARIES)
SET(SEARCH_PATHS
$ENV{ProgramFiles}/freeimage/include
$ENV{SystemDrive}/freeimage/include
$ENV{ProgramFiles}/freeimage
$ENV{SystemDrive}/freeimage
)
IF(FREEIMAGEPLUS_ROOT)
SET(SEARCH_PATHS
${FREEIMAGEPLUS_ROOT}
${FREEIMAGEPLUS_ROOT}/include
${SEARCH_PATHS}
)
ENDIF()
FIND_PATH(FREEIMAGEPLUS_INCLUDE_DIRS
NAMES FreeImagePlus.h
PATHS ${SEARCH_PATHS}
NO_DEFAULT_PATH)
IF(NOT FREEIMAGEPLUS_INCLUDE_DIRS) # now look in system locations
FIND_PATH(FREEIMAGEPLUS_INCLUDE_DIRS NAMES FreeImagePlus.h)
ENDIF(NOT FREEIMAGEPLUS_INCLUDE_DIRS)
SET(FREEIMAGEPLUS_LIBRARY_DIRS)
IF(FREEIMAGEPLUS_ROOT)
SET(FREEIMAGEPLUS_LIBRARY_DIRS ${FREEIMAGEPLUS_ROOT})
IF(EXISTS "${FREEIMAGEPLUS_ROOT}/lib")
SET(FREEIMAGEPLUS_LIBRARY_DIRS ${FREEIMAGEPLUS_LIBRARY_DIRS} ${FREEIMAGEPLUS_ROOT}/lib)
ENDIF()
IF(EXISTS "${FREEIMAGEPLUS_ROOT}/lib/static")
SET(FREEIMAGEPLUS_LIBRARY_DIRS ${FREEIMAGEPLUS_LIBRARY_DIRS} ${FREEIMAGEPLUS_ROOT}/lib/static)
ENDIF()
ENDIF()
# FREEIMAGE
# Without system dirs
FIND_LIBRARY(FREEIMAGEPLUS_LIBRARY
NAMES freeimageplus
PATHS ${FREEIMAGEPLUS_LIBRARY_DIRS}
NO_DEFAULT_PATH
)
IF(NOT FREEIMAGEPLUS_LIBRARY) # now look in system locations
FIND_LIBRARY(FREEIMAGEPLUS_LIBRARY NAMES freeimageplus)
ENDIF(NOT FREEIMAGEPLUS_LIBRARY)
SET(FREEIMAGEPLUS_LIBRARIES)
IF(FREEIMAGEPLUS_LIBRARY)
SET(FREEIMAGEPLUS_LIBRARIES ${FREEIMAGEPLUS_LIBRARY})
ENDIF()
IF(FREEIMAGEPLUS_INCLUDE_DIRS AND FREEIMAGEPLUS_LIBRARIES)
SET(FREEIMAGEPLUS_FOUND TRUE)
IF(NOT FREEIMAGEPLUS_FIND_QUIETLY)
MESSAGE(STATUS "Found FreeImagePlus: headers at ${FREEIMAGEPLUS_INCLUDE_DIRS}, libraries at ${FREEIMAGEPLUS_LIBRARY_DIRS} :: ${FREEIMAGEPLUS_LIBRARIES}")
ENDIF(NOT FREEIMAGEPLUS_FIND_QUIETLY)
ELSE(FREEIMAGEPLUS_INCLUDE_DIRS AND FREEIMAGEPLUS_LIBRARIES)
SET(FREEIMAGEPLUS_FOUND FALSE)
IF(FREEIMAGEPLUS_FIND_REQUIRED)
MESSAGE(STATUS "FreeImagePlus not found")
ENDIF(FREEIMAGEPLUS_FIND_REQUIRED)
ENDIF(FREEIMAGEPLUS_INCLUDE_DIRS AND FREEIMAGEPLUS_LIBRARIES)
MARK_AS_ADVANCED(FREEIMAGEPLUS_INCLUDE_DIRS FREEIMAGEPLUS_LIBRARIES)