Skip to content

Commit

Permalink
Merge pull request #204 from SyneRBI/fix-windows-build
Browse files Browse the repository at this point in the history
Fix windows build problems with FFTW, making it also safer on other systems if we build our own
  • Loading branch information
KrisThielemans authored Jul 5, 2020
2 parents 8216608 + 013ca44 commit 098b11a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
16 changes: 15 additions & 1 deletion SuperBuild/External_FFTW3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,26 @@ else()
${${proj}_EP_ARGS_DIRS}
CONFIGURE_COMMAND ${${proj}_SOURCE_DIR}/configure --enable-float --with-pic --prefix ${${proj}_INSTALL_DIR}
)
set( FFTW3_ROOT_DIR ${${proj}_INSTALL_DIR} )
#set( FFTW3_ROOT_DIR ${${proj}_INSTALL_DIR} )

# current FindFFTW3.cmake ignores FFTW3_ROOT_DIR https://github.com/CCPPETMR/SIRF-SuperBuild/issues/147
# let's hope for the best
# ideally we would also set DFFTW3_LIBRARIES but that's hard and system dependent
set(FFTW3_CMAKE_ARGS
-DFFTW3_INCLUDE_DIR:PATH=${FFTW_Install_Dir}/include
)

endif()


else()
if(${USE_SYSTEM_${externalProjName}})
find_package(${proj} ${${externalProjName}_REQUIRED_VERSION} ${${externalProjName}_COMPONENTS} REQUIRED)
message(STATUS "USING the system ${externalProjName}, found FFTW3_INCLUDE_DIR=${FFTW3_INCLUDE_DIR}, FFTW3_LIBRARY=${FFTW3_LIBRARY}")
set(FFTW3_CMAKE_ARGS
-DFFTW3_INCLUDE_DIR:PATH=${FFTW3_INCLUDE_DIR}
-DFFTW3_LIBRARIES:FILEPATH=${FFTW3_LIBRARIES}
)
endif()
ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}"
${${proj}_EP_ARGS_DIRS}
Expand All @@ -89,3 +101,5 @@ endif()
# LABELS
# "FIND_PACKAGE"
#)

message(STATUS "FFTW3_CMAKE_ARGS=${FFTW3_CMAKE_ARGS}")
1 change: 1 addition & 0 deletions SuperBuild/External_Gadgetron.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
-DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARIES}
-DGTEST_ROOT:PATH=${GTEST_ROOT}
${HDF5_CMAKE_ARGS}
${FFTW3_CMAKE_ARGS}
-DISMRMRD_DIR:PATH=${ISMRMRD_DIR}
-DUSE_MKL:BOOL=${Gadgetron_USE_MKL}
-DUSE_CUDA:BOOL=${${proj}_USE_CUDA}
Expand Down
1 change: 1 addition & 0 deletions SuperBuild/External_ISMRMRD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
-DCMAKE_PREFIX_PATH:PATH=${SUPERBUILD_INSTALL_DIR}
-DCMAKE_LIBRARY_PATH:PATH=${SUPERBUILD_INSTALL_DIR}/lib
${HDF5_CMAKE_ARGS}
${FFTW3_CMAKE_ARGS}
${Boost_CMAKE_ARGS}
DEPENDS
${${proj}_DEPENDENCIES}
Expand Down
1 change: 1 addition & 0 deletions SuperBuild/External_SIRF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr
-DMATLAB_DEST_DIR:PATH=${MATLAB_DEST_DIR}
-DSTIR_DIR:PATH=${STIR_DIR}
${HDF5_CMAKE_ARGS}
${FFTW3_CMAKE_ARGS}
-DISMRMRD_DIR:PATH=${ISMRMRD_DIR}
-DSWIG_EXECUTABLE:FILEPATH=${SWIG_EXECUTABLE}
-DDISABLE_PYTHON:BOOL=${DISABLE_PYTHON}
Expand Down

0 comments on commit 098b11a

Please sign in to comment.