[Insight-users] How to set CMakeList.txt for indicating the header files?

Luis Ibanez luis . ibanez at kitware . com
Fri, 01 Aug 2003 01:02:10 -0400


Hi Hon,

Please try adding a lines with the INCLUDE_DIRECTORIES
specifying the directory where you put the files from
FltkImageViewer.  You actually will have to add in this
command both the SOURCE and BINARY directories of the
FltkImageViewer library.  It should look something like


INCLUDE_DIRECTORIES(
   /home/wong/src/FltkImageViewer
   /home/wong/bin/FltkImageViewer
)

The reason for including the binary directory is that
FLTK uses "fluid" for generating C++ code from .fl files.
The C++ files are writen in the binary directory. Henceforth,
the binary directory where you built the FltkImageViewer library
will also contain some fluid-generated C++ header files.


Regards,


   Luis



-------------------------------

Hon-Cheng Wong wrote:
> Dear Luis and all ITK users,
> 
>         In order to separate the GaussianFilter in independent project, 
> I have separated
> 
> the FLTKImageViewer library and built it. And I also reorganized the 
> CMakeList.txt files
> 
> of GaussianFilter as you told me in the previous E-mail, however, I 
> still got the errors that
> 
> the isolated project doesnˇ¦t know what path to search for these header 
> files.
> 
>  
> 
>        I would like to know what commands need to be added in CMakeList.txt
> 
> for finding these header files. I tried to edit INCLUDE_DIRECTORIES
> 
> in the original CMakeList.txt of GaussianFilter for my case, but I 
> haven't succeeded.
> 
>  
> 
> Thank you very much again!!
> 
>  
> 
> Regards,
> 
> Hugo
> 
>  
> 
> Hon-Cheng Wong, Hugo
> 
> Faculty of Information Technology,
> 
> Macao University of Science and Technology,
> 
> Macao, China
> 
>  
> 
> Here are the error messages I got:
> 
>  
> 
> --------------------Configuration: GaussianFilter - Win32 
> Release--------------------
> 
> Compiling...
> 
> GaussianFilter.cxx
> 
> D:\ITK Research\GaussianFilter\liFilterConsole.h(20) : fatal error C1083:
> 
> Cannot open include file: 'fltkImageViewer.h': No such file or directory
> 
> liFilterConsole.cxx
> 
> D:\ITK Research\GaussianFilter\liFilterConsole.h(20) : fatal error C1083:
> 
> Cannot open include file: 'fltkImageViewer.h': No such file or directory
> 
> liFilterConsoleGUI.cxx
> 
> D:/ITK Research/GaussianFilter/liFilterConsoleGUI.h(8) : fatal error C1083:
> 
> Cannot open include file: 'fltkLightButton.h': No such file or directory
> 
> Generating Code...
> 
> Error executing cl.exe.
> 
>  
> 
> ALL_BUILD - 3 error(s), 0 warning(s)
> 
>  
> 
> And here is the modified *CMakeList.txt* of GaussianFilter:
> 
>  
> 
> PROJECT(GaussianFilter)
> 
>  
> 
> 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)
> 
>  
> 
> FIND_PACKAGE(FLTK)
> 
>   IF(FLTK_FOUND)
> 
>     INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
> 
> ENDIF(FLTK_FOUND)
> 
>  
> 
> FIND_LIBRARY(FLTK_IMAGE_VIEWER_LIBRARY NAMES FltkImageViewer
> 
>           PATHS /usr/lib /usr/local/lib
> 
>           /usr/local/fltk/lib
> 
>           /usr/X11R6/lib)
> 
>  
> 
> ADD_EXECUTABLE(GaussianFilter liFilterConsole.cxx
> 
>                liFilterConsoleBase.cxx GaussianFilter.cxx)
> 
> ADD_EXECUTABLE(GaussianFilter2D liFilterConsole2D.cxx
> 
>                liFilterConsole2DBase.cxx GaussianFilter2D.cxx)
> 
>  
> 
> FLTK_WRAP_UI(GaussianFilter liFilterConsoleGUI.fl)
> 
> FLTK_WRAP_UI(GaussianFilter2D liFilterConsole2DGUI.fl)
> 
>  
> 
> TARGET_LINK_LIBRARIES(GaussianFilter ITKFltkImageViewer ITKIO 
> ITKBasicFilters)
> 
> TARGET_LINK_LIBRARIES(GaussianFilter2D ITKFltkImageViewer ITKIO 
> ITKBasicFilters)
> 
>  
>