Skip to content

Commit 8d5ba5b

Browse files
author
Cyrille Favreau
authored
Merge pull request #381 from favreau/master
Replaced FreeImage with OpenImageIO and removed Exiv dependency
2 parents e28af86 + 924ebdc commit 8d5ba5b

File tree

20 files changed

+598
-408
lines changed

20 files changed

+598
-408
lines changed

CMake/FindOpenImageIO.cmake

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
#
2+
# Copyright 2016 Pixar
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "Apache License")
5+
# with the following modification; you may not use this file except in
6+
# compliance with the Apache License and the following modification to it:
7+
# Section 6. Trademarks. is deleted and replaced with:
8+
#
9+
# 6. Trademarks. This License does not grant permission to use the trade
10+
# names, trademarks, service marks, or product names of the Licensor
11+
# and its affiliates, except as required to comply with Section 4(c) of
12+
# the License and to reproduce the content of the NOTICE file.
13+
#
14+
# You may obtain a copy of the Apache License at
15+
#
16+
# http://www.apache.org/licenses/LICENSE-2.0
17+
#
18+
# Unless required by applicable law or agreed to in writing, software
19+
# distributed under the Apache License with the above modification is
20+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21+
# KIND, either express or implied. See the Apache License for the specific
22+
# language governing permissions and limitations under the Apache License.
23+
#
24+
25+
if(UNIX)
26+
find_path(OIIO_BASE_DIR
27+
include/OpenImageIO/oiioversion.h
28+
HINTS
29+
"${OIIO_LOCATION}"
30+
"$ENV{OIIO_LOCATION}"
31+
"/opt/oiio"
32+
)
33+
set(LIBNAME libOpenImageIO.so)
34+
if(DEFINED PXR_USE_DEBUG_BUILD)
35+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND ${PXR_USE_DEBUG_BUILD} MATCHES ON)
36+
set(LIBNAME libOpenImageIO_d.dylib)
37+
endif()
38+
endif()
39+
find_path(OIIO_LIBRARY_DIR
40+
${LIBNAME}
41+
HINTS
42+
"${OIIO_LOCATION}"
43+
"$ENV{OIIO_LOCATION}"
44+
"${OIIO_BASE_DIR}"
45+
PATH_SUFFIXES
46+
lib/
47+
DOC
48+
"OpenImageIO library path"
49+
)
50+
elseif(WIN32)
51+
find_path(OIIO_BASE_DIR
52+
include/OpenImageIO/oiioversion.h
53+
HINTS
54+
"${OIIO_LOCATION}"
55+
"$ENV{OIIO_LOCATION}"
56+
)
57+
find_path(OIIO_LIBRARY_DIR
58+
OpenImageIO.lib
59+
HINTS
60+
"${OIIO_LOCATION}"
61+
"$ENV{OIIO_LOCATION}"
62+
"${OIIO_BASE_DIR}"
63+
PATH_SUFFIXES
64+
lib/
65+
DOC
66+
"OpenImageIO library path"
67+
)
68+
endif()
69+
70+
find_path(OIIO_INCLUDE_DIR
71+
OpenImageIO/oiioversion.h
72+
HINTS
73+
"${OIIO_LOCATION}"
74+
"$ENV{OIIO_LOCATION}"
75+
"${OIIO_BASE_DIR}"
76+
PATH_SUFFIXES
77+
include/
78+
DOC
79+
"OpenImageIO headers path"
80+
)
81+
82+
list(APPEND OIIO_INCLUDE_DIRS ${OIIO_INCLUDE_DIR})
83+
set(DEBUG_POSTFIX )
84+
if(DEFINED PXR_USE_DEBUG_BUILD)
85+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND ${PXR_USE_DEBUG_BUILD} MATCHES ON)
86+
set(DEBUG_POSTFIX _d)
87+
endif()
88+
endif()
89+
foreach(OIIO_LIB
90+
OpenImageIO${DEBUG_POSTFIX}
91+
OpenImageIO_Util${DEBUG_POSTFIX}
92+
)
93+
94+
find_library(OIIO_${OIIO_LIB}_LIBRARY
95+
${OIIO_LIB}
96+
HINTS
97+
"${OIIO_LOCATION}"
98+
"$ENV{OIIO_LOCATION}"
99+
"${OIIO_BASE_DIR}"
100+
PATH_SUFFIXES
101+
lib/
102+
DOC
103+
"OIIO's ${OIIO_LIB} library path"
104+
)
105+
106+
if(OIIO_${OIIO_LIB}_LIBRARY)
107+
list(APPEND OIIO_LIBRARIES ${OIIO_${OIIO_LIB}_LIBRARY})
108+
endif()
109+
endforeach(OIIO_LIB)
110+
111+
foreach(OIIO_BIN
112+
iconvert
113+
idiff
114+
igrep
115+
iinfo
116+
iv
117+
maketx
118+
oiiotool)
119+
120+
find_program(OIIO_${OIIO_BIN}_BINARY
121+
${OIIO_BIN}
122+
HINTS
123+
"${OIIO_LOCATION}"
124+
"$ENV{OIIO_LOCATION}"
125+
"${OIIO_BASE_DIR}"
126+
PATH_SUFFIXES
127+
bin/
128+
DOC
129+
"OIIO's ${OIIO_BIN} binary"
130+
)
131+
if(OIIO_${OIIO_BIN}_BINARY)
132+
list(APPEND OIIO_BINARIES ${OIIO_${OIIO_BIN}_BINARY})
133+
endif()
134+
endforeach(OIIO_BIN)
135+
136+
if(OIIO_INCLUDE_DIRS AND EXISTS "${OIIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h")
137+
file(STRINGS ${OIIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h
138+
MAJOR
139+
REGEX
140+
"#define OIIO_VERSION_MAJOR.*$")
141+
file(STRINGS ${OIIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h
142+
MINOR
143+
REGEX
144+
"#define OIIO_VERSION_MINOR.*$")
145+
file(STRINGS ${OIIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h
146+
PATCH
147+
REGEX
148+
"#define OIIO_VERSION_PATCH.*$")
149+
string(REGEX MATCHALL "[0-9]+" MAJOR ${MAJOR})
150+
string(REGEX MATCHALL "[0-9]+" MINOR ${MINOR})
151+
string(REGEX MATCHALL "[0-9]+" PATCH ${PATCH})
152+
set(OIIO_VERSION "${MAJOR}.${MINOR}.${PATCH}")
153+
endif()
154+
155+
# handle the QUIETLY and REQUIRED arguments and set OIIO_FOUND to TRUE if
156+
# all listed variables are TRUE
157+
include(FindPackageHandleStandardArgs)
158+
159+
find_package_handle_standard_args(OpenImageIO
160+
REQUIRED_VARS
161+
OIIO_LIBRARIES
162+
OIIO_INCLUDE_DIRS
163+
VERSION_VAR
164+
OIIO_VERSION
165+
)

CMake/Findexiv2.cmake

Lines changed: 0 additions & 51 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(${NAME}_MODULES_DIR ${PROJECT_SOURCE_DIR})
4040
set(CMAKE_CXX_STANDARD 17)
4141

4242
find_package(glm REQUIRED)
43-
find_package(FreeImage REQUIRED)
43+
find_package(OpenImageIO REQUIRED)
4444
find_package(ospray)
4545
find_package(OptiX6)
4646
find_package(CUDA)

0 commit comments

Comments
 (0)