In itkv4 only use ITK_LIBRARIES<br><br><div>target_link_libraries( image_read_write  ### And here?</div><div>  ${ITK_LIBRARIES}</div><div>  itkCommon </div><div>  itkIO </div><div> )<br>should be<br><div>target_link_libraries( image_read_write  ### And here?</div>
<div>  ${ITK_LIBRARIES}<br> )</div><br></div><br><br><div class="gmail_quote">On Thu, Jan 5, 2012 at 5:38 PM, Matt McCormick <span dir="ltr">&lt;<a href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Wenwu,<br>
<br>
To build against a specific version, set the CMake configuration<br>
variable, &quot;ITK_DIR&quot;, to the path of the install or build for that<br>
version.<br>
<br>
Hope this helps,<br>
<br>
Matt<br>
<div><div></div><div class="h5"><br>
On Thu, Jan 5, 2012 at 5:06 PM, Wenwu &lt;<a href="mailto:cool.wenwu@gmail.com">cool.wenwu@gmail.com</a>&gt; wrote:<br>
&gt; Hi everyone,<br>
&gt;<br>
&gt; At the beginning, The ITK3.2 was installed in my computer(window7, visual<br>
&gt; studio 2008 c++ express),  then I  installed the lastest version ITK4.0, so<br>
&gt; now, how to write the CMakeLists?  Maybe it is very easy! If you are free,<br>
&gt; please tell me!!  Thank you very much!<br>
&gt;<br>
&gt;<br>
&gt; e.g,<br>
&gt;<br>
&gt; cmake_minimum_required( VERSION 2.8 )<br>
&gt; project( image_read_write )<br>
&gt;<br>
&gt; find_package (ITK)  ### here, because of two ITK version in my computer, how<br>
&gt; to specify the specific one?<br>
&gt; if (ITK_FOUND)<br>
&gt;   include ( ${ITK_USE_FILE} )<br>
&gt; else (ITK_FOUND)<br>
&gt;   message (FATAL_ERROR &quot;Cannot build without ITK, Please set ITK_DIR.&quot;)<br>
&gt; endif (ITK_FOUND)<br>
&gt;<br>
&gt; add_executable( image_read_write main.cxx )<br>
&gt;<br>
&gt; target_link_libraries( image_read_write  ### And here?<br>
&gt;   ${ITK_LIBRARIES}<br>
&gt;   itkCommon<br>
&gt;   itkIO<br>
&gt;  )<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Wenwu Zhu<br>
&gt; University of Strasbourg, France<br>
&gt; Email address: <a href="mailto:cool.wenwu@gmail.com">cool.wenwu@gmail.com</a><br>
&gt;<br>
&gt;<br>
</div></div>&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<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>
</blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>