<font size="2"><font face="verdana,sans-serif">Which ITK version are you using? ITK4 has to be built in directory separate from source, and you have to point your project to the build dir. Here is a working example:</font></font><div>
<font size="2"><font face="verdana,sans-serif"><br></font></font></div><div><font size="2"><div><font class="Apple-style-span" face="'courier new', monospace">cmake_minimum_required(VERSION 2.6)</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">PROJECT(bugTester CXX)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace">FIND_PACKAGE(ITK REQUIRED)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">INCLUDE(${ITK_USE_FILE})</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">FIND_PACKAGE(VTK REQUIRED)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">INCLUDE(${VTK_USE_FILE})</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">FIND_PACKAGE(Qt4)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">SET(QT_USE_QTOPENGL 1)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">SET(QT_USE_QTDESIGNER ON)</font></div><div><font class="Apple-style-span" face="'courier new', monospace">INCLUDE(${QT_USE_FILE})</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div>
<div>
<font class="Apple-style-span" face="'courier new', monospace">ADD_EXECUTABLE(bugTester bugTester.cpp)</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" face="'courier new', monospace">TARGET_LINK_LIBRARIES(bugTester ${QT_LIBRARIES})</font></div><div><font class="Apple-style-span" face="'courier new', monospace">TARGET_LINK_LIBRARIES(bugTester ${ITK_LIBRARIES})</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">TARGET_LINK_LIBRARIES(bugTester vtkVolumeRendering vtkRendering vtkCommon QVTK)</font></div></font><br><div class="gmail_quote">On Fri, Oct 7, 2011 at 18:41, Rick Frank <span dir="ltr"><<a href="mailto:rickf@fullspectrumsw.com">rickf@fullspectrumsw.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hi<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m trying to configure and generate a simple Visual Studio 10 project to use VTK and ITK together.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Here is my CmakeLists.txt file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">cmake_minimum_required(VERSION 2.6)<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">PROJECT(ReadDICOM)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">find_package(VTK REQUIRED)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">include(${VTK_USE_FILE})<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">find_package(ITK REQUIRED)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">include(${ITK_USE_FILE})<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">add_executable(ReadDICOM ReadDICOM.cxx)<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas">target_link_libraries(ReadDICOM ${VTK_LIBRARIES} ${ITK_LIBRARIES})<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Everything goes ok with CMake, the headers and libraries seem to be in the project properties, but Visual Studio can only find VTK headers, etc.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">It can’t find the ITK headers, and doesn’t compile if I try to use ITK. Is there something I’m missing? ( I’m a newbie with CMake) <u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">Thanks<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><font color="#888888"><p class="MsoNormal">Rick<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">
<u></u> <u></u></p></font></div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>