[Insight-users] Regarding to set INCLUDE_DIRECTORIES.

Reinhold Füreder R . Fureder at exeter . ac . uk
Sat, 2 Aug 2003 09:03:45 +0100


Hi Hugo,

In addition to these settings could you have a look in your MSVC++
project to check what is actually generated by CMake?
In the project settings for this particular project, tab "C/C++",
category "Preprocessor", edit field "Additional include directories".

Reinhold

-----Original Message-----
From: insight-users-admin at itk . org [mailto:insight-users-admin at itk . org]
On Behalf Of Hon-Cheng Wong
Sent: Saturday, August 02, 2003 7:11 AM
To: ITK Users
Subject: [Insight-users] Regarding to set INCLUDE_DIRECTORIES.
Importance: High


Dear Luis and all ITK users,
         In order to separate the GaussianFilter in independent project,

I have separated the FLTKImageViewer library and built it using 
IN-SOURCE build. Both my source and bin of FLTKImageViewer 
are located at D:\ITK Research\FltkImageViewer. My GaussianFilter 
is located at D:\ITK Research\GaussianFilter.

         I have tried to the following:
INCLUDE_DIRECTORIES(
 D:/ITK Research/FltkImageViewer
 ${GaussianFilter_SOURCE_DIR}
 ${GaussianFilter_BINARY_DIR}
 )

           However, it doesn't work, the compiler still could not file
the header files 
which locate in D:\ITK Research\FltkImageViewer. I have read the
document 
of CMake, but I could not find out how to specify a user directory like
my
case in it.

           Could you help me to find out the way to set the
INCLUDE_DIRECTORIES
correctly?

Thank you very much in advance!!

Regards,
Hugo

Hon-Cheng Wong, Hugo
Faculty of Information Technology,
Macao University of Science and Technology,
Macao, China

I got the following messages:

--------------------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)

INCLUDE_DIRECTORIES(
 D:/ITK Research/FltkImageViewer
 ${GaussianFilter_SOURCE_DIR}
 ${GaussianFilter_BINARY_DIR}
 )
 
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)