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

William A. Hoffman billlist at nycap . rr . com
Fri, 21 Nov 2003 14:09:04 -0500


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