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

Bing Jian bjian at cise . ufl . edu
Sat, 22 Nov 2003 16:50:44 -0500 (EST)


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!



-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu


On Fri, 21 Nov 2003, William A. Hoffman wrote:

> The quickest way would be something like this:
>
> FIND_LIBRARY(FFTW_LIBRARY fftw)
> FIND_LIBRARY(TIFF_LIBRARY tiff)
> LINK_LIBRARIES(${FFTW_LIBRARY} ${TIFF_LIBRARY})
>
>
> -Bill
> At 01:52 PM 11/21/2003, Bing Jian wrote:
> >Hello,
> >
> >  Last week I posted a similar question, but am still confused about it.
> >
> >Say I have a simple project with CMakeLists.txt as follows:
> >
> >FIND_PACKAGE(ITK)
> >IF(ITK_FOUND)
> >  INCLUDE(${ITK_USE_FILE})
> >ELSE(ITK_FOUND)
> >  MESSAGE(FATAL_ERROR
> >          "Cannot build InsightApplications without ITK.  Please set
> >ITK_DIR.")
> >ENDIF(ITK_FOUND)
> >
> >                                                                                                                                                            LINK_LIBRARIES (
> >ITKBasicFilters
> >ITKCommon
> >ITKIO
> >ITKNumerics
> >)
> >
> >PROJECT(ITKTestApplication)
> >ADD_EXECUTABLE(TestApp1 TestApp1.cxx)
> >TARGET_LINK_LIBRARIES(TestApp1 ITKCommon)
> >
> >Yeah, it works. Now, I am going to include some functions
> >from other libraries such as fftw, libtiff, etc. What should
> >I do in CMakeLists.txt?
> >
> >  Thanks!
> >
> >
> >
> >
> >_______________________________________________
> >Insight-users mailing list
> >Insight-users at itk . org
> >http://www . itk . org/mailman/listinfo/insight-users
>
>