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
/
libfftw.cmake
63 lines (52 loc) · 1.99 KB
/
libfftw.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
62
63
#
# Install libfftw from source
#
if (NOT libfftw_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
external_source (libfftw
3.3.2
fftw-3.3.2.tar.gz
6977ee770ed68c85698c7168ffa6e178
http://www.fftw.org)
message ("Installing ${libfftw_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${libfftw_NAME}
PREFIX ${BUILDEM_DIR}
URL ${libfftw_URL}
URL_MD5 ${libfftw_MD5}
UPDATE_COMMAND ""
PATCH_COMMAND ""
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${libfftw_SRC_DIR}/configure
--prefix=${BUILDEM_DIR}
--enable-shared
LDFLAGS=${BUILDEM_LDFLAGS}
CPPFLAGS=-I${BUILDEM_DIR}/include
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
)
# Add additional steps to build and install the fftw single-precision libraries.
# (It is not possible to generate single and double precision libraries in one make step.)
# Configure single-precision
ExternalProject_Add_Step(${libfftw_NAME} singlefloat-configure
DEPENDEES install
COMMAND cd ${libfftw_SRC_DIR}-build && ${BUILDEM_ENV_STRING} ${libfftw_SRC_DIR}/configure
--prefix=${BUILDEM_DIR}
--enable-shared
--enable-float # This creates libfftw3f single-precision libraries INSTEAD OF the default double libraries.
LDFLAGS=${BUILDEM_LDFLAGS}
CPPFLAGS=-I${BUILDEM_DIR}/include
)
# build single-precision
ExternalProject_Add_Step(${libfftw_NAME} singlefloat-build
DEPENDEES singlefloat-configure
COMMAND cd ${libfftw_SRC_DIR}-build && ${BUILDEM_ENV_STRING} $(MAKE)
)
# install single-precision
ExternalProject_Add_Step(${libfftw_NAME} singlefloat-install
DEPENDEES singlefloat-build
COMMAND cd ${libfftw_SRC_DIR}-build && ${BUILDEM_ENV_STRING} $(MAKE) install
)
set_target_properties(${libfftw_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT libfftw_NAME)