This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
openexr.cmake
61 lines (50 loc) · 2.03 KB
/
openexr.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
#
# Install openexr from source
#
if (NOT openexr_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (PkgConfig)
include (BuildSupport)
include (PatchSupport)
include (ilmbase)
include (zlib)
external_source (openexr
1.6.1
openexr-1.6.1.tar.gz
11951f164f9c872b183df75e66de145a
http://download.savannah.nongnu.org/releases/openexr)
set (openexr_LIBRARIES_FLAGS "-lHalf -lIex -lIlmImf -lIlmThread -lImath")
set (openexr_INCLUDE_DIR ${BUILDEM_INCLUDE_DIR}/OpenEXR)
include_directories (${openexr_INCLUDE_DIR})
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(openexr_PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE}
${openexr_SRC_DIR}/exrmaketiled/main.cpp ${PATCH_DIR}/openexr-exrmaketiled.patch
${openexr_SRC_DIR}/exrenvmap/main.cpp ${PATCH_DIR}/openexr-exrenvmap.patch
# Add extra patch for clang compatibility
${openexr_SRC_DIR}/configure ${PATCH_DIR}/openexr-clang.patch )
else()
set(openexr_PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE}
${openexr_SRC_DIR}/exrmaketiled/main.cpp ${PATCH_DIR}/openexr-exrmaketiled.patch
${openexr_SRC_DIR}/exrenvmap/main.cpp ${PATCH_DIR}/openexr-exrenvmap.patch )
endif()
message ("Installing ${openexr_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${openexr_NAME}
DEPENDS ${ilmbase_NAME} ${zlib_NAME}
PREFIX ${BUILDEM_DIR}
URL ${openexr_URL}
URL_MD5 ${openexr_MD5}
UPDATE_COMMAND ""
PATCH_COMMAND ${openexr_PATCH_COMMAND}
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${openexr_SRC_DIR}/configure
--prefix=${BUILDEM_DIR}
--disable-ilmbasetest
PKG_CONFIG_PATH=${BUILDEM_PKGCONFIG_DIR}
LDFLAGS=${BUILDEM_LDFLAGS}
CPPFLAGS=-I${BUILDEM_DIR}/include
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
set_target_properties(${openexr_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT openexr_NAME)