[Insight-users] how to add other libraries into cmake

Luis Ibanez luis . ibanez at kitware . com
Sun, 23 Nov 2003 19:17:21 -0500


Hi Bing,

ITK is already using FFTW, a FindFFTW.cmake
file is available at

         Insight/CMake

and it is used from the main CMakeLists.txt
file (line 54) as

    OPTION(USE_FFTW "Use the FFTW library" OFF)
    MARK_AS_ADVANCED(USE_FFTW)
    IF( USE_FFTW )
      FIND_PACKAGE( FFTW )
    ENDIF( USE_FFTW )

About TIFF, there is a FindTIFF.cmake in
CMake/Modules, so you can simply call it
in your CMakeLists.txt file as

      FIND_PACKAGE( TIFF )

Then do

    INCLUDE( ${TIFF_INCLUDE_DIR} )
    LINK_LIBRARY( ${TIFF_LIBRARIES} )


The FFTW already sets the path for headers
and sets the names of libraries to link.


Regards,


   Luis


----------------
Bing Jian wrote:
 > Hi, William,
 >
 >    Thanks a lot.
 >    I can use this way in my linux box since my fftw and libtiff are
 > installed into /usr/local and thus can be found without -I and -L.
 > However in Visual Studio, this way can only add items in link page,
 > I still need to add additional include path mannually. I tried to
 > add something like
 >     INCLUDE(${FFTW_DIR})
 > but seems CMake does not understand it.
 >    Any help? Thanks in advance!
 >
 >
 >