Commit 933088b8 authored by Rashad Kanavath's avatar Rashad Kanavath

SuperBuild: fix fftw patch for macosx

parent c9ff660f
if(NOT __EXTERNAL_FFTW__)
if( __EXTERNAL_FFTW__)
return()
else()
set(__EXTERNAL_FFTW__ 1)
endif()
if(USE_SYSTEM_FFTW)
# TODO : use ITK's FindFFTW
#find_package ( FFTW )
message(STATUS " Using FFTW system version")
else()
SETUP_SUPERBUILD(PROJECT FFTW)
if(USE_SYSTEM_FFTW)
message(STATUS " Using FFTW system version")
return()
endif()
set(FFTWF_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWF)
set(FFTWD_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWD)
SETUP_SUPERBUILD(PROJECT FFTW)
if(MSVC)
# TODO : get precompiled binaries as not all MSVC versions can compile FFTW
message(STATUS " FFTW SuperBuild is not available yet...")
add_custom_target(FFTW)
else()
message(STATUS " Using FFTW SuperBuild version")
set(FFTWF_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWF)
set(FFTWD_SB_SRC ${CMAKE_BINARY_DIR}/FFTW/src/FFTWD)
# Compile the float version of FFTW
ExternalProject_Add(FFTWF
PREFIX FFTW/FFTWF
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTWF_SB_SRC}
BINARY_DIR ${FFTWF_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTWF_SB_SRC}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
--disable-static
--enable-float
--enable-threads
--disable-fortran
--disable-dependency-tracking
DEPENDS ${FFTW_DEPENDENCIES}
)
if(MSVC)
# TODO : get precompiled binaries as not all MSVC versions can compile FFTW
message(STATUS " FFTW SuperBuild is not available yet...")
add_custom_target(FFTW)
return()
endif()
if(APPLE)
SUPERBUILD_PATCH_SOURCE(FFTWF "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
endif()
# Compile the double version of FFTW
ExternalProject_Add(FFTWD
PREFIX FFTW/FFTWD
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTWD_SB_SRC}
BINARY_DIR ${FFTWD_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTWD_SB_SRC}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
--disable-static
--disable-float
--enable-threads
--disable-fortran
--disable-dependency-tracking
)
message(STATUS " Using FFTW SuperBuild version")
if(APPLE)
SUPERBUILD_PATCH_SOURCE(FFTWD "patch-for-at-rpath" ${CMAKE_SOURCE_DIR}/patches/FFTW)
endif()
# Compile the float version of FFTW
ExternalProject_Add(FFTWF
PREFIX FFTW/FFTWF
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTWF_SB_SRC}
BINARY_DIR ${FFTWF_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTWF_SB_SRC}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
--disable-static
--enable-float
--enable-threads
--disable-fortran
--disable-dependency-tracking
DEPENDS ${FFTW_DEPENDENCIES}
)
ExternalProject_Add(FFTW
PREFIX FFTW
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS FFTWF FFTWD
)
SUPERBUILD_PATCH_SOURCE(FFTWF "patch-for-at-rpath")
set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
# Compile the double version of FFTW
ExternalProject_Add(FFTWD
PREFIX FFTW/FFTWD
URL "http://www.fftw.org/fftw-3.3.4.tar.gz"
URL_MD5 2edab8c06b24feeb3b82bbb3ebf3e7b3
SOURCE_DIR ${FFTWD_SB_SRC}
BINARY_DIR ${FFTWD_SB_SRC}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CONFIGURE_COMMAND
${SB_ENV_CONFIGURE_CMD}
${FFTWD_SB_SRC}/configure
--prefix=${SB_INSTALL_PREFIX}
--enable-shared
--disable-static
--disable-float
--enable-threads
--disable-fortran
--disable-dependency-tracking
)
endif()
endif()
endif()
SUPERBUILD_PATCH_SOURCE(FFTWD "patch-for-at-rpath")
ExternalProject_Add(FFTW
PREFIX FFTW
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS FFTWF FFTWD
)
set(_SB_FFTW_INCLUDE_PATH ${SB_INSTALL_PREFIX}/include)
--- fftw-3.3.4.orig/configure 2016-04-19 09:26:21.000000000 +0200
+++ fftw-3.3.4/configure 2016-04-19 09:27:21.000000000 +0200
@@ -10776,9 +10776,9 @@
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \@rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment