[832b36]: CMakeModules / FindOpenEXR.cmake Maximize Restore History

Download this file

FindOpenEXR.cmake    158 lines (135 with data), 5.5 kB

  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
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Try to find the OpenEXR libraries
# This check defines:
#
# OPENEXR_FOUND - system has OpenEXR
# OPENEXR_INCLUDE_DIR - OpenEXR include directory
# OPENEXR_LIBRARIES - Libraries needed to use OpenEXR
#
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)
# in cache already
SET(OPENEXR_FOUND TRUE)
else (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)
IF (NOT WIN32 OR MINGW)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
INCLUDE(UsePkgConfig)
PKGCONFIG(OpenEXR _OpenEXRIncDir _OpenEXRLinkDir _OpenEXRLinkFlags _OpenEXRCflags)
ENDIF (NOT WIN32 OR MINGW)
FIND_PATH(OPENEXR_INCLUDE_DIR ImfRgbaFile.h
${_OpenEXRIncDir}
${_OpenEXRIncDir}/OpenEXR/
/usr/include
/usr/local/include
${SOURCE_BASE_DIR}/Deploy/include
)
FIND_LIBRARY(OPENEXR_HALF_LIBRARY NAMES Half
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease
${SOURCE_BASE_DIR}/Deploy/lib/Release
)
FIND_LIBRARY(OPENEXR_IEX_LIBRARY
NAMES Iex
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease
${SOURCE_BASE_DIR}/Deploy/lib/Release
)
FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY NAMES IlmThread
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease
${SOURCE_BASE_DIR}/Deploy/lib/Release
)
FIND_LIBRARY(OPENEXR_IMATH_LIBRARY NAMES Imath
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease
${SOURCE_BASE_DIR}/Deploy/lib/Release
)
FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease
${SOURCE_BASE_DIR}/Deploy/lib/Release
)
FIND_LIBRARY(OPENEXR_HALF_LIBRARY_DEBUG NAMES Half
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug
${SOURCE_BASE_DIR}/Deploy/lib/Debug
)
FIND_LIBRARY(OPENEXR_IEX_LIBRARY_DEBUG
NAMES Iex
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug
${SOURCE_BASE_DIR}/Deploy/lib/Debug
)
FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY_DEBUG NAMES IlmThread
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug
${SOURCE_BASE_DIR}/Deploy/lib/Debug
)
FIND_LIBRARY(OPENEXR_IMATH_LIBRARY_DEBUG NAMES Imath
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug
${SOURCE_BASE_DIR}/Deploy/lib/Debug
)
FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY_DEBUG NAMES IlmImf
PATHS
${_OPENEXRLinkDir}
${SYSTEM_LIB_DIRS}
${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug
${SOURCE_BASE_DIR}/Deploy/lib/Debug
)
if (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
set(OPENEXR_FOUND TRUE)
if (OPENEXR_ILMTHREAD_LIBRARY)
# set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBARY} CACHE STRING "The libraries needed to use OpenEXR")
if (MSVC)
set(OPENEXR_LIBRARIES optimized ${OPENEXR_IMATH_LIBRARY} optimized ${OPENEXR_ILMIMF_LIBRARY} optimized ${OPENEXR_IEX_LIBRARY} optimized ${OPENEXR_HALF_LIBRARY} optimized ${OPENEXR_ILMTHREAD_LIBRARY} debug ${OPENEXR_IMATH_LIBRARY_DEBUG} debug ${OPENEXR_ILMIMF_LIBRARY_DEBUG} debug ${OPENEXR_IEX_LIBRARY_DEBUG} debug ${OPENEXR_HALF_LIBRARY_DEBUG} debug ${OPENEXR_ILMTHREAD_LIBRARY_DEBUG} CACHE STRING "Libraries needed for OpenEXR")
else (MSVC)
set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY})
endif (MSVC)
else (OPENEXR_ILMTHREAD_LIBRARY)
if (MSVC)
set(OPENEXR_LIBRARIES optimized ${OPENEXR_IMATH_LIBRARY} optimized ${OPENEXR_ILMIMF_LIBRARY} optimized ${OPENEXR_IEX_LIBRARY} optimized ${OPENEXR_HALF_LIBRARY} debug ${OPENEXR_IMATH_LIBRARY_DEBUG} debug ${OPENEXR_ILMIMF_LIBRARY_DEBUG} debug ${OPENEXR_IEX_LIBRARY_DEBUG} debug ${OPENEXR_HALF_LIBRARY_DEBUG} CACHE STRING "The libraries needed to use OpenEXR")
else (MSVC)
set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR")
endif (MSVC)
endif (OPENEXR_ILMTHREAD_LIBRARY)
endif (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
if (OPENEXR_FOUND)
if (NOT OpenEXR_FIND_QUIETLY)
message(STATUS "Found OPENEXR: ${OPENEXR_LIBRARIES}")
endif (NOT OpenEXR_FIND_QUIETLY)
else (OPENEXR_FOUND)
if (OpenEXR_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find OPENEXR")
endif (OpenEXR_FIND_REQUIRED)
endif (OPENEXR_FOUND)
MARK_AS_ADVANCED(
OPENEXR_INCLUDE_DIR
OPENEXR_LIBRARIES
OPENEXR_ILMIMF_LIBRARY
OPENEXR_IMATH_LIBRARY
OPENEXR_IEX_LIBRARY
OPENEXR_HALF_LIBRARY
OPENEXR_ILMTHREAD_LIBRARY )
endif (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)