[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] getting started
From:       Steven Hansen <stevenhansen01 () yahoo ! com>
Date:       2005-11-11 4:03:46
Message-ID: 20051111040346.42551.qmail () web54208 ! mail ! yahoo ! com
[Download RAW message or body]

Hey everybody,
 
    I'm a new VTK user, and I just need a few tips to get started.  I mainly need \
help with the CMakeLists.txt file.  I have an example VTK program called "Helix" that \
I am trying to run.  I have installed VTK, and it contains the libraries that Helix \
needs to run, but when I try to build the Helix solution, there are errors saying \
that it cannot find vtkRenderWindowInteractor.h, vtkActor.h, etc.  I can find these \
files on my own, and they are in directories like C:/VTK/Rendering/   However, this \
is in the original VTK directory, and not the VTK_Build directory.  All of the right \
directories are in the CMakeLists.txt file in these lines:  
TARGET_LINK_LIBRARIES( helix
  ${QT_LIBRARIES}
  vtkRendering
  vtkFiltering
  vtkGraphics
  vtkIO
  vtkCommon
 
but there is something that isn't right.  Either I didn't build VTK right, and the \
h-files didn't get into the build directory, or I need to know how to add lines into \
the CMakeLists.txt file to tell my Helix build where to go find the right files.  \
Here is my entire CMakeLists.txt file in case it helps:  (P.S.- I am working in \
WindowsXP.)  
PROJECT(helix)
 
SET(VTK_DIR C:/VTK_ALL/VTK)
INCLUDE_DIRECTORIES(${VTK_DIR}/include/vtk)
LINK_DIRECTORIES(${VTK_DIR}/lib/vtk)
 
#FIND_PACKAGE(VTK)
#IF(NOT VTK_DIR)
#  MESSAGE(FATAL_ERROR "Please set VTK_DIR.")
#ENDIF(NOT VTK_DIR)
#INCLUDE(${VTK_USE_FILE})
 
# use what QVTK built with
SET(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
SET(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
SET(DESIRED_QT_VERSION ${VTK_DESIRED_QT_VERSION} CACHE STRING "")
FIND_PACKAGE(Qt)
IF(QT_USE_FILE)
  INCLUDE(${QT_USE_FILE})
ELSE(QT_USE_FILE)
  SET(QT_LIBRARIES   ${QT_QT_LIBRARY})
ENDIF(QT_USE_FILE)
 
SET (HelixSrcs
  main.cpp
  QVTKWidget.cxx
)
SET(UIS helix.ui)
SET (HelixHeaders QVTKWidget.h)
 
# Use the include path and library for Qt that is used by VTK.
INCLUDE_DIRECTORIES(
  ${QT_INCLUDE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
)
 
QT_WRAP_UI( helix UIHeaders UISrcs ${UIS})
QT_WRAP_CPP( shelix MOCSrcs ${HelixHeaders} )
SET_SOURCE_FILES_PROPERTIES(${HelixSrcs} PROPERTIES
                            OBJECT_DEPENDS "${UIHeaders}")
 

# It's nice to have the ui in the windows project file...just double click on it
# and designer comes up on that ui file :)
IF (${CMAKE_BUILD_TOOL} MATCHES "msdev")
  SET (HelixSrcs ${HelixSrcs} ${UIS})
ENDIF (${CMAKE_BUILD_TOOL} MATCHES "msdev")
IF (${CMAKE_BUILD_TOOL} MATCHES "devenv")
  SET (SimpleViewSrcs ${SimpleViewSrcs} ${UIS})
ENDIF (${CMAKE_BUILD_TOOL} MATCHES "devenv")
 
#ADD_EXECUTABLE( helix WIN32 ${HelixSrcs} ${UISrcs} ${MOCSrcs})
ADD_EXECUTABLE( helix ${HelixSrcs} ${UISrcs} ${MOCSrcs})
 
TARGET_LINK_LIBRARIES( helix
  ${QT_LIBRARIES}
  vtkRendering
  vtkFiltering
  vtkGraphics
  vtkIO
  vtkCommon
)


[Attachment #3 (text/html)]

<DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hey everybody,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; I'm a new VTK user, and I just need a \
few tips to get started.&nbsp; I mainly need help with the CMakeLists.txt file.&nbsp; \
I have an example VTK program called "Helix" that I am trying to run.&nbsp; I have \
installed VTK, and it contains the libraries that Helix needs to run, but when I try \
to build the Helix solution, there are errors saying that it cannot find \
vtkRenderWindowInteractor.h, vtkActor.h, etc.&nbsp; I can find these files on my own, \
and they are in directories like&nbsp;C:/VTK/Rendering/&nbsp;&nbsp; However, this is \
in the original VTK directory, and not the VTK_Build directory.&nbsp; All of the \
right directories are in the CMakeLists.txt file in these lines:</FONT></DIV> \
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial \
size=2>TARGET_LINK_LIBRARIES( helix<BR>&nbsp; ${QT_LIBRARIES}<BR>&nbsp; \
vtkRendering<BR>&nbsp; vtkFiltering<BR>&nbsp; vtkGraphics<BR>&nbsp; vtkIO<BR>&nbsp; \
vtkCommon</FONT></DIV> <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>but there is something that isn't right.&nbsp; Either I \
didn't build VTK right, and the h-files didn't get into the build directory, or I \
need to know how to add lines into the CMakeLists.txt file to tell my Helix build \
where to go find the right files.&nbsp; Here is my entire CMakeLists.txt file&nbsp;in \
case it helps:&nbsp; (P.S.- I am working in WindowsXP.)</FONT></DIV> <DIV><FONT \
face=Arial size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial \
size=2>PROJECT(helix)</FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>SET(VTK_DIR \
C:/VTK_ALL/VTK)<BR>INCLUDE_DIRECTORIES(${VTK_DIR}/include/vtk)<BR>LINK_DIRECTORIES(${VTK_DIR}/lib/vtk)</FONT></DIV>
 <DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#FIND_PACKAGE(VTK)<BR>#IF(NOT VTK_DIR)<BR>#&nbsp; \
MESSAGE(FATAL_ERROR "Please set VTK_DIR.")<BR>#ENDIF(NOT \
VTK_DIR)<BR>#INCLUDE(${VTK_USE_FILE})</FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># use what QVTK built with<BR>SET(QT_MOC_EXECUTABLE \
${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")<BR>SET(QT_UIC_EXECUTABLE \
${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")<BR>SET(QT_QMAKE_EXECUTABLE \
${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")<BR>SET(DESIRED_QT_VERSION \
${VTK_DESIRED_QT_VERSION} CACHE STRING \
"")<BR>FIND_PACKAGE(Qt)<BR>IF(QT_USE_FILE)<BR>&nbsp; \
INCLUDE(${QT_USE_FILE})<BR>ELSE(QT_USE_FILE)<BR>&nbsp; SET(QT_LIBRARIES&nbsp;&nbsp; \
${QT_QT_LIBRARY})<BR>ENDIF(QT_USE_FILE)</FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>SET (HelixSrcs<BR>&nbsp; main.cpp<BR>&nbsp; \
QVTKWidget.cxx<BR>)<BR>SET(UIS helix.ui)<BR>SET (HelixHeaders \
QVTKWidget.h)</FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2># Use the include path and library for Qt that is used \
by VTK.<BR>INCLUDE_DIRECTORIES(<BR>&nbsp; ${QT_INCLUDE_DIR}<BR>&nbsp; \
${CMAKE_CURRENT_BINARY_DIR}<BR>&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}<BR>)</FONT></DIV> \
<DIV>&nbsp;</DIV> <DIV><FONT face=Arial size=2>QT_WRAP_UI( helix UIHeaders UISrcs \
${UIS})<BR>QT_WRAP_CPP( shelix MOCSrcs ${HelixHeaders} \
)<BR>SET_SOURCE_FILES_PROPERTIES(${HelixSrcs} \
PROPERTIES<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
OBJECT_DEPENDS "${UIHeaders}")</FONT></DIV> <DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR># It's nice to have the ui in the windows project file...just double click \
on it<BR># and designer comes up on that ui file :)<BR>IF (${CMAKE_BUILD_TOOL} \
MATCHES "msdev")<BR>&nbsp; SET (HelixSrcs ${HelixSrcs} ${UIS})<BR>ENDIF \
(${CMAKE_BUILD_TOOL} MATCHES "msdev")<BR>IF (${CMAKE_BUILD_TOOL} MATCHES \
"devenv")<BR>&nbsp; SET (SimpleViewSrcs ${SimpleViewSrcs} ${UIS})<BR>ENDIF \
(${CMAKE_BUILD_TOOL} MATCHES "devenv")</DIV> <DIV>&nbsp;</DIV>
<DIV>#ADD_EXECUTABLE( helix WIN32 ${HelixSrcs} ${UISrcs} \
${MOCSrcs})<BR>ADD_EXECUTABLE( helix ${HelixSrcs} ${UISrcs} ${MOCSrcs})</DIV> \
<DIV>&nbsp;</DIV> <DIV>TARGET_LINK_LIBRARIES( helix<BR>&nbsp; \
${QT_LIBRARIES}<BR>&nbsp; vtkRendering<BR>&nbsp; vtkFiltering<BR>&nbsp; \
vtkGraphics<BR>&nbsp; vtkIO<BR>&nbsp; vtkCommon<BR>)</FONT></DIV></FONT></DIV></DIV>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic