forked from fblumenthal/buildem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ilmbase.cmake
57 lines (47 loc) · 1.8 KB
/
ilmbase.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
#
# Install ilmbase from source
#
if (NOT ilmbase_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
include (PatchSupport)
include (zlib)
external_source (ilmbase
1.0.2
ilmbase-1.0.2.tar.gz
26c133ee8ca48e1196fbfb3ffe292ab4
http://download.savannah.nongnu.org/releases/openexr)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ilmbase_PATCH_COMMAND ${PATCH_EXE}
${ilmbase_SRC_DIR}/Imath/ImathMatrix.h ${PATCH_DIR}/ilmbase-1.patch
# Add extra patch for clang compatibility
${ilmbase_SRC_DIR}/configure ${PATCH_DIR}/ilmbase-clang.patch )
else()
set(ilmbase_PATCH_COMMAND ${PATCH_EXE}
${ilmbase_SRC_DIR}/Imath/ImathMatrix.h ${PATCH_DIR}/ilmbase-1.patch )
endif()
message ("Installing ${ilmbase_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${ilmbase_NAME}
DEPENDS ${zlib_NAME}
PREFIX ${BUILDEM_DIR}
URL ${ilmbase_URL}
URL_MD5 ${ilmbase_MD5}
UPDATE_COMMAND ""
PATCH_COMMAND ${ilmbase_PATCH_COMMAND}
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${ilmbase_SRC_DIR}/configure
--prefix=${BUILDEM_DIR}
"LDFLAGS=${BUILDEM_LDFLAGS}"
"CXXFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
if (${BUILDEM_ADDITIONAL_CXX_FLAGS} MATCHES "libstdc")
ExternalProject_Add_Step(${ilmbase_NAME} ${ilmbase_NAME}-configure-stdlib
COMMAND bash ${PATCH_DIR}/ilmbase-fix-makefiles-stdlib.sh ${ilmbase_SRC_DIR}/../ilmbase-1.0.2-build
DEPENDEES configure
)
endif()
set_target_properties(${ilmbase_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT ilmbase_NAME)