[Insight-users] cmake question

David Macias Verde dmacver at gobiernodecanarias.org
Wed, 11 Feb 2004 13:20:00 +0000


Hello:

I am trying to make my first steps with cmake. Before that I was using
qmake as I am working qt,vtk and, now, itk. I can't compile my code
because of this error:

Building dependencies. cmake.depends...
-- Loading VTK CMake commands
-- Loading VTK CMake commands - done
Building object file main.o...
Building object file mirs-1.1.o...
Building executable /home/dmacias/src/mytools/mirs-1.3/myProject...
/usr/bin/ld: cannot find -lVtkQt
collect2: ld returned 1 exit status
make[1]: *** [/home/dmacias/src/mytools/mirs-1.3/myProject] Error 1
make: *** [default_target] Error 2

My CMakeList.txt, surely wrong, is:

PROJECT( myProject )

FIND_PACKAGE ( ITK )
IF (  ITK_FOUND  )
         INCLUDE(  ${USE_ITK_FILE}  )
ENDIF(   ITK_FOUND   )

FIND_PACKAGE ( VTK )
IF (   VTK_FOUND   )
         INCLUDE(  ${USE_VTK_FILE}  )
ENDIF(   VTK_FOUND   )

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

INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
/usr/local/VtkQt/src
${myProject_SOURCE_DIR}=20
/usr/local/InsightApplications-1.6.0/Auxiliary/vtk
)

LINK_DIRECTORIES(
${VTKQT_LIBRARY_PATH}
)

ADD_EXECUTABLE( myProject main.cxx mirs-1.1.cxx  mirs.h )

TARGET_LINK_LIBRARIES ( myProject =20
ITKBasicFilters ITKCommon ITKIO
vtkRendering  vtkGraphics vtkHybrid
vtkImaging vtkIO vtkFiltering vtkCommon
${QT_QT_LIBRARY}
VtkQt
)

My .bash_profile is:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

PATH=3D/usr/local/bin:/sbin/:/usr/local/sbin/:/bin:/usr/bin:/usr/sbin:/usr/=
bin/X11:/usr/X11R6/bin:/root/bin:/usr/local/share/tkabber:/usr/local/share/=
tkabber/jabberlib-tclxml

# User specific environment and startup programs
# Place where you packages are:
export PACKAGES=3D/usr/local
export VTK_DIR=3D$PACKAGES/VTK
export VTK_DATA=3D$PACKAGES/VTKData-release-4-2/Data
export VTK_DATA_ROOT=3D$PACKAGES/VTKData-release-4-2/Data
export VTK_HOME=3D$PACKAGES/VTK
export PATH=3D$VTK_HOME/bin:$PACKAGES/include/vtk:$PATH
export LD_LIBRARY_PATH=3D$VTK_HOME/bin:$LD_LIBRARY_PATH
export VTKQT_LIBRARY_PATH=3D$PACKAGES/VtkQt/lib
export VTKQT_SRCS=3D$PACKAGES/VtkQt/src

#The same for VtkQt
export LD_LIBRARY_PATH=3D$PACKAGES/VtkQt/lib:$LD_LIBRARY_PATH

unset USERNAME


May anyone give a hand?

Thanks

--=20
David Macias Verde <david.maciasverde at gobiernodecanarias.org>
Servicio de F=EDsica M=E9dica - Hospital de Gran Canaria Dr. Negr=EDn