[Insight-users] itkio library
Luis Ibanez
luis.ibanez@kitware.com
Tue, 09 Apr 2002 17:01:50 -0400
This is a multi-part message in MIME format.
--------------020800090608060702030702
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi Lydia,
Thanks for sending the full list of error messages
that was very helpful.
I just followed step by step the process that you
described and could reproduce the problem that you
reported. It seems that all the problem is related
with paths and libraries that are missing in your
CMakeList.txt file.
For example, the first error in you compilation can
be solved by adding:
${ITK_SOURCE_DIR}/Auxiliary/MetaImage/IView
to the INCLUDE_DIRECTORIES() block in CMakeLists.txt
I made a set of changes along these lines on the
CMakeLists.txt file from the GaussianFilter and
got it to compile, link and run.
Attached is the modified CMakeLists.txt file with
which you can make the GaussianFilter example work
from outside ITK (as an external project).
Note that it is specifying a lot of directories for
the INCLUDE paths, the LINK paths and is also listing
all the libraries required for linking, in particular
I had to add:
ITKNumerics
VXLNumerics
What happens with the examples inside the ITK.dsw is
that they inherit some of these paths from the global
ITK settings. When the project is made external you
have to provide CMake with all the paths (include/link)
and libraries that your code requires to build.
Please let us know if this CMakeLists.txt file works
for you and if the same approach solve the first
problem you were having with IO.
Thanks
Luis
=====================================
ycl lydia wrote:
> That's waht I did
> 1. I downloaded itkwinzip file
> 2. I installed it using cmakesetup
> 3. I compiled and linked all the projects inside.
> Then
> 1.I copied the gaussian example project outside itk directory
> 2. I built it again using cmakesetup : for the source directory I used
> the new deirctory of the gaussian filter example.
> 3. I kept the cmakelists file as it is (I think that's the mistake)
> 4. I loded the dsw file and built it and that's the error file I get.
> it's attached to the massage.
> I know I should change something inside the cmakelist file but what is it?
>
>
--------------020800090608060702030702
Content-Type: text/plain;
name="CMakeLists.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="CMakeLists.txt"
PROJECT(GaussianFilterProject)
#
# Find ITK
#
FIND_PATH( ITK_BINARY_DIR itkConfigure.h )
# Load in the values from ITK if found
IF ( ITK_BINARY_DIR )
LOAD_CACHE(${ITK_BINARY_DIR})
INCLUDE (${ITK_SOURCE_DIR}/itkCMakeOptions.cmake)
ENDIF (ITK_BINARY_DIR )
INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
INCLUDE_DIRECTORIES(
${ITK_SOURCE_DIR}/Code/Common
${ITK_SOURCE_DIR}/Code/BasicFilters
${ITK_SOURCE_DIR}/Code/Algorithms
${ITK_SOURCE_DIR}/Code/IO
${ITK_SOURCE_DIR}/Auxiliary/MetaImage/IView
${ITK_SOURCE_DIR}/Auxiliary/MetaImage
${ITK_SOURCE_DIR}/Auxiliary/FltkImageViewer
${ITK_SOURCE_DIR}/Examples/GaussianFilter
${ITK_BINARY_DIR}/Auxiliary/FltkImageViewer
${ITK_BINARY_DIR}/Examples/GaussianFilter
${ITK_BINARY_DIR}/Auxiliary/MetaImage/IView
${FLTK_INCLUDE_PATH}
${OPENGL_INCLUDE_PATH}
)
LINK_DIRECTORIES(
${ITK_BINARY_DIR}/Code/Common
${ITK_BINARY_DIR}/Code/BasicFilters
${ITK_BINARY_DIR}/Code/Algorithms
${ITK_BINARY_DIR}/Code/Numerics
${ITK_BINARY_DIR}/Code/Numerics/vxl
${ITK_BINARY_DIR}/Code/IO
${ITK_BINARY_DIR}/Auxiliary/MetaImage
${ITK_BINARY_DIR}/Auxiliary/FltkImageViewer
${ITK_BINARY_DIR}/Auxiliary/MetaImage/IView
${ITK_BINARY_DIR}/Examples/GaussianFilter
)
SOURCE_FILES(GaussianFilter_SRCS
liFilterConsole
liFilterConsoleBase
GaussianFilter
)
SOURCE_FILES(GaussianFilter_GUI_SRCS
liFilterConsoleGUI.fl
)
LINK_LIBRARIES (
ITKCommon
ITKBasicFilters
ITKNumerics
VXLNumerics
ITKIO
IView
FltkImageViewer
${FLTK_LIBRARY}
${OPENGL_LIBRARY}
${GLU_LIBRARY}
)
IF(WIN32)
LINK_LIBRARIES(
wsock32
)
ENDIF(WIN32)
IF(UNIX)
LINK_LIBRARIES (
${CMAKE_X_LIBS} -lm
)
ENDIF(UNIX)
ADD_EXECUTABLE(GaussianFilter GaussianFilter_SRCS)
FLTK_WRAP_UI(GaussianFilter GaussianFilter_GUI_SRCS)
--------------020800090608060702030702--