<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:2008243178;
        mso-list-type:hybrid;
        mso-list-template-ids:-454249728 67567631 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US>Hello everybody,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>I use CMake to configure a VTK+Qt project
in Visual Studio 9 on a Windows 7 machine. According to information in this mailing
list and other examples I create my own CMakeLists.txt file and it works&#8230;almost!
I can build and link my project correctly against VTK but if I start my program
within (or outside of) Visual Studio I get a error that some (I think all) VTK
dlls are missing e.g. vtkCommon.dll. &nbsp;In my environment variables I
already set a path (in the Path-variable or VTK_DIR) to the binary folder of the
compiled VTK sources. Within this folder I have a debug and release folder. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Currently, I can only resolve this behavior
in one of two ways. <o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span
lang=EN-US><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span lang=EN-US>I set the path in my environment
variables to the debug or release folder and can run the program in debug or release
mode.<o:p></o:p></span></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span
lang=EN-US><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span lang=EN-US>I set PATH=$(QTDIR)\bin;$(VTK_DIR)\$(OutDir)
as entry in the debugging environment in the project properties (QTDIR was set
in the environment variables too)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>But I think this manual effort is not
necessary if I configure my CMakeLists.txt correctly. So I do something wrong
and maybe somebody can help me. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>At the end of this mail you find the (shortened)
content of my CMakeLists.txt file.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Many thanks in advance for any help or hint<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Rocco Gasteiger<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>PROJECT(VTKQtProject)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US># find and setup Qt4 for this project<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>FIND_PACKAGE(QT4 REQUIRED)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US># find and setup VTK<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>FIND_PACKAGE(VTK REQUIRED)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>SET(QT_USE_QTOPENGL TRUE)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>INCLUDE(${QT_USE_FILE})<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>IF(NOT VTK_USE_RENDERING)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; MESSAGE(FATAL_ERROR &quot;Example
${PROJECT_NAME} requires VTK_USE_RENDERING.&quot;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ENDIF(NOT VTK_USE_RENDERING)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>INCLUDE(${VTK_USE_FILE})<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US># Set source, header, and Qt files<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>SET(SRCS_CPP &#8230;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>SET(SRCS_H &#8230;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>SET(CLIENT_UI &#8230;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>SET(CLIENT_MOC_SRCS &#8230;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>QT4_WRAP_UI(SRCS_CPP ${CLIENT_UI})<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>QT4_WRAP_CPP(SRCS_CPP ${CLIENT_MOC_SRCS})<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>IF(UNIX)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; ADD_EXECUTABLE(MyVTKQtProject
${SRCS_CPP} ${SRCS_H} ${CLIENT_UI} &nbsp;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ELSEIF(APPLE)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; ADD_EXECUTABLE(MyVTKQtProject MACOSX_BUNDLE
${SRCS_CPP} ${SRCS_H} ${CLIENT_UI} )<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ELSEIF(WIN32) <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; ADD_EXECUTABLE(MyVTKQtProject ${SRCS_CPP}
${SRCS_H} ${CLIENT_UI} )<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ENDIF()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>IF(WIN32)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; TARGET_LINK_LIBRARIES(MyVTKQtProject
${QT_LIBRARIES} ${QT_GIF_PLUGIN} ${QT_JPEG_PLUGIN} vtkCommon vtkexpat
vtkFiltering vtkfreetype vtkftgl vtkGraphics vtkHybrid vtkImaging vtkIO vtkjpeg
vtkpng vtkRendering vtktiff vtkzlib vtkVolumeRendering QVTK)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ELSE()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>&nbsp; TARGET_LINK_LIBRARIES(MyVTKQtProject
${QT_LIBRARIES} vtkCommon vtkexpat vtkFiltering vtkfreetype vtkftgl vtkGraphics
vtkHybrid vtkImaging vtkIO vtkjpeg vtkpng vtkRendering vtktiff vtkzlib
vtkVolumeRendering QVTK)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>ENDIF()<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

</div>

</body>

</html>