[Insight-users] problem with cmake

imho imho@skynet.be
Thu, 06 Feb 2003 15:37:58 +0100


Hi,

I try to combinate Qt, VTK and ITK together and it works fine on windows 
(with visual) but I'd like to make it works on linux too, so I try to 
write a cmakelist file.

So I've tried to write it, but make give me this error :

/usr/bin/ld: cannot find -lvtkHybrid
collect2: ld returned 1 exit status

Maybe I do all wrong, I don't know :/

Thanks for helping me


here is my cmakelist.txt file :
--------------------------------------------------------------
PROJECT(NewProject)

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (USE_VTK_FILE)
   INCLUDE(${USE_VTK_FILE})
ENDIF (USE_VTK_FILE)



#
# Find ITK
#
INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
   INCLUDE(${USE_ITK_FILE})
ENDIF(USE_ITK_FILE)

#
# Find QT
#
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)


INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
/home/imho/memoire/VTK
/home/imho/memoire/VTK/Rendering
/home/imho/memoire/VTK/Imaging
/home/imho/memoire/VTK/Graphics
/home/imho/memoire/VTK/Hybrid
/home/imho/memoire/VTK/Common
/home/imho/memoire/VTK/Filtering
/home/imho/memoire/VTK/IO
/home/imho/memoire/VTK/Patented
/home/imho/memoire/VTK/Parallel
/home/imho/memoire/VTK/Utilities/zlib
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/Algorithms
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/IO
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/BasicFilters
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/Numerics
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/SpatialObject
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/Numerics/vxl
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/Numerics/vxl/vcl
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Code/Numerics/vxl/vnl
/home/imho/memoire/ITK/InsightToolkit-1.0.0/Examples/vtkITK/Common
/home/imho/NewProject/vtk_qt1.6_vtk4.0

/usr/lib/qt3/include

)

LINK_LIBRARIES (

vtkRendering
vtkGraphics	
vtkHybrid	
vtkImaging
vtkIO
vtkFiltering
vtkCommon
vtkzlib

ITKNumerics
VXLNumerics
ITKCommon
ITKBasicFilters
ITKAlgorithms
ITKIO
ITKMetaIO
itkpng
itkzlib

   ${QT_QT_LIBRARY}
)


IF(WIN32)
ADD_DEFINITIONS(-DQT_DLL)
ENDIF(WIN32)

SET(NewProject_SRCS

affichage16coupes.cpp  		
affichage1coupe.cpp    	 newprojectwindow.cpp
affichage4coupes.cpp   	 traitementITK.cpp
affichage4vues.cpp     main.cpp			 vtkInteractorStyleCustom.cpp
affichageVTK3D.cpp
affichageVTK.cpp

)

SET(NewProject_MOC_SRCS

affichage16coupes.h  affichageVTK3D.h
affichage1coupe.h    affichageVTK.h    newprojectwindow.h
affichage4coupes.h   	       traitementITK.h
affichage4vues.h        vtkInteractorStyleCustom.h
)

IF(QT_WRAP_CPP)
   QT_WRAP_CPP(NewProject NewProject_SRCS NewProject_MOC_SRCS)
ENDIF(QT_WRAP_CPP)


ADD_EXECUTABLE(NewProject NewProject_SRCS)