[Insight-users] better way to compile with fftw library with USE_SYSTEM_FFTW=OFF?

gang song songgang97 at gmail.com
Tue Jun 21 19:49:31 EDT 2011


Hi,

I am trying to compile ITK applications on a machine without FFTW
pre-installed. So when I compiled ITK, I set the following:
USE_SYSTEM_FFTW=OFF
USE_FFTWD=ON
USE_FFTWF=ON

And there is a fftw/ subdirectory compiled under the ITK binary directory.



And in my own CMakeLists, I have to add the following:
option(USE_FFTWD "Use double precision fftw if found" OFF)
option(USE_FFTWF "Use single precision fftw if found" OFF)
option(USE_SYSTEM_FFTW "Use an installed version of fftw" OFF)
if (USE_FFTWD OR USE_FFTWF)
	if(USE_SYSTEM_FFTW)
    	    find_package( FFTW )
    	    link_directories(${FFTW_LIBDIR})
	else(USE_SYSTEM_FFTW)
    	    link_directories(${ITK_DIR}/fftw/lib)
    	    include_directories(${ITK_DIR}/fftw/include)
	endif(USE_SYSTEM_FFTW)
endif(USE_FFTWD OR USE_FFTWF)


This is the only way I found to get my application compiled. I have to
set manually my own USE_SYSTEM_FFTW / USE_FFTWD / USE_FFTWF to match
the values when ITK library was compiled. Is there a better way to
automatically find the correct FFTW library path from the ITK_DIR ?



Thanks

-Gang


More information about the Insight-users mailing list