forked from fblumenthal/buildem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libjpeg.cmake
38 lines (31 loc) · 1.28 KB
/
libjpeg.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
#
# Install libjpeg from source
#
if (NOT libjpeg_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
external_source (libjpeg
8d
jpegsrc.v8d.tar.gz
52654eb3b2e60c35731ea8fc87f1bd29
http://www.ijg.org/files)
message ("Installing ${libjpeg_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${libjpeg_NAME}
PREFIX ${BUILDEM_DIR}
URL ${libjpeg_URL}
URL_MD5 ${libjpeg_MD5}
UPDATE_COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILDEM_DIR}/man/man1
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ./configure
--prefix=${BUILDEM_DIR}
--enable-shared
"LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
"CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) LIBTOOL=./libtool # Must use the libtool that is built in place by the libjpeg Makfile (not the system libtool!)
BUILD_IN_SOURCE 1
TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) check
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) LIBTOOL=./libtool install
)
set_target_properties(${libjpeg_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT libjpeg_NAME)