Hello,<br>

<br>

Thank you for replying. <br>

<br>

Well I am trying to build an ITK class. I have three CMakeLists.txt files.<br>

<br>

<span style="color: rgb(0, 0, 0);">1. My code is spread across three
directories. Two of them are in the parent directory called
ExamplePipeline3. The other two BasicFilters and Common are within this
parent directory and comprises of .h and .txx files. The problem I face
is that when I run <span style="color: rgb(255, 0, 0);">make</span>&nbsp;
it doesn't recognise the files in the subdirectories BasicFilters and
Common. And because of this alot of errors occur in my code.</span><br style="color: rgb(0, 0, 0);">

<br style="color: rgb(0, 0, 0);">

<span style="color: rgb(0, 0, 0);">1. The First CMakeLists.txt is in a directory called ExamplePipeline3</span><br>

<span style="color: rgb(255, 102, 102);">PROJECT( PrimMinimumSpanningTree )</span><br style="color: rgb(255, 102, 102);">

<br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">FIND_PACKAGE ( ITK )</span><br style="color: rgb(255, 102, 102);">

<br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">IF ( ITK_FOUND )</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">&nbsp;&nbsp; INCLUDE(${USE_ITK_FILE})</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">ELSE (ITK_FOUND)</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">&nbsp;&nbsp; MESSAGE(FATAL_ERROR&nbsp; &quot;Cannot build without ITK.&nbsp; Please set ITK_DIR.&quot;)</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">ENDIF( ITK_FOUND )</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);"></span><span style="color: rgb(255, 102, 102);"></span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);"></span><span style="color: rgb(255, 102, 102);"></span><span style="color: rgb(255, 102, 102);">SUBDIRS(BasicFilters Common)</span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);"></span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);"></span><br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">ADD_EXECUTABLE( PrimMinimumSpanningTree&nbsp; ...<span style="color: rgb(255, 204, 153);">.some .txx files and .h files</span>)</span><br style="color: rgb(255, 102, 102);">

<br style="color: rgb(255, 102, 102);">

<span style="color: rgb(255, 102, 102);">TARGET_LINK_LIBRARIES ( PrimMinimumSpanningTree ITKBasicFilters ITKCommon ITKIO)</span><br style="color: rgb(102, 0, 204);">

<br>

3. The CMakeLists.txt file in BasicFilters :<br>
&nbsp;&nbsp;<span style="color: rgb(255, 153, 102);"> <span style="color: rgb(255, 102, 102);">PROJECT(BasicFilters) </span></span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">MESSAGE(&quot;ItkGraph BasicFilters&quot;)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">ADD_EXECUTABLE(BasicFilters ....<span style="color: rgb(102, 102, 204);">some .h and .txx files</span>)</span><br style="color: rgb(255, 102, 102);">
<br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">IF(UNIX)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">&nbsp; ADD_DEFINITIONS(&quot;-LANG:std&quot;)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">ENDIF(UNIX)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">SET_TARGET_PROPERTIES(BasicFilters PROPERTIES LINKER_LANGUAGE CXX)&nbsp; </span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">TARGET_LINK_LIBRARIES(BasicFilters)</span><br style="color: rgb(255, 102, 102);">
<br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">INSTALL_TARGETS(/lib/ BasicFilters)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">INSTALL_FILES(/include/PrimMinimumSpanningTree &quot;\\.h$&quot;)<br>
<br>
<br style="color: rgb(255, 153, 102);">
</span>
3. The CMakeLists.txt file in Common :<br>
<span style="color: rgb(255, 102, 102);">PROJECT(Common)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">MESSAGE(&quot;ItkGraph Common&quot;)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">ADD_EXECUTABL(Common&nbsp; ...<span style="color: rgb(51, 102, 255);">some .h and .txx files</span>)</span><br style="color: rgb(255, 102, 102);">
<br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">IF(UNIX)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">&nbsp; ADD_DEFINITIONS(&quot;-LANG:std&quot;)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">ENDIF(UNIX)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">SET_TARGET_PROPERTIES(Common PROPERTIES LINKER_LANGUAGE CXX)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">TARGET_LINK_LIBRARIES(Common)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">INSTALL_TARGETS(/lib/ Common)</span><br style="color: rgb(255, 102, 102);">
<span style="color: rgb(255, 102, 102);">INSTALL_FILES(/include/PrimMinimumSpanningTree &quot;\\.h$&quot;)</span><br>
<br>
<br>
Would it be possible for you to tell me where I have gone wrong. Those
files in Common and BasicFilters had not been compiled before.<br>
<br>
Sincerely,<br>
<br>
Sonali Barua.<br>
<br><br><div><span class="gmail_quote">On 9/18/06, <b class="gmail_sendername">Gaëtan Lehmann</b> &lt;<a href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Sonali,<br><br>Can you provide your CMakeLists.txt file, as well as your directory<br>structure ?<br>It would be easier to help with that :-)<br><br>Thanks,<br><br>Gaetan<br><br>Le Sun, 17 Sep 2006 22:33:46 +0200, Sonali Barua &lt;
<a href="mailto:barua.sonali@gmail.com">barua.sonali@gmail.com</a>&gt;<br>a écrit:<br><br>&gt; Hello,<br>&gt;<br>&gt; Well I have done that. And there are several folders inside a folder<br>&gt; called<br>&gt; ItkG. I have added the INCLUDE_DIRECTORIES command and also the subdirs
<br>&gt; command because there were several sub directories inside it. I also made<br>&gt; the individual CmakeLists.txt file for each of the subdirs inside this<br>&gt; directory. But when I run the cmake . command I get an error that says
<br>&gt; that<br>&gt; they cannot recognise the subdirs mentioned. What must I do in order to<br>&gt; make<br>&gt; it recognise my dirs in the Include directories command?<br>&gt;<br>&gt; Sincerely,<br>&gt;<br>&gt; Sonali Barua.
<br>&gt;<br>&gt; On 9/17/06, Gaëtan Lehmann &lt;<a href="mailto:gaetan.lehmann@jouy.inra.fr">gaetan.lehmann@jouy.inra.fr</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Le Sun, 17 Sep 2006 03:20:53 +0200, Sonali Barua<br>&gt;&gt; &lt;
<a href="mailto:barua.sonali@gmail.com">barua.sonali@gmail.com</a>&gt;<br>&gt;&gt; a écrit:<br>&gt;&gt;<br>&gt;&gt; &gt; Hello,<br>&gt;&gt; &gt;<br>&gt;&gt; &gt; I am facing a problem in my CMakeLists.txt file. I would like to add
<br>&gt;&gt; &gt; several<br>&gt;&gt; &gt; ITK files in a folder that consitutes a library that isn't yet part of<br>&gt;&gt; &gt; the<br>&gt;&gt; &gt; original ITK library using cmake. What are the commands that I have to
<br>&gt;&gt; &gt; use<br>&gt;&gt; &gt; so that my source files can use these set of header and .txx files<br>&gt;&gt; while<br>&gt;&gt; &gt; compiling make?<br>&gt;&gt;<br>&gt;&gt; Hi,<br>&gt;&gt;<br>&gt;&gt; The command INCLUDE_DIRECTORIES() should do what you want.
<br>&gt;&gt; Please look at <a href="http://cmake.org/HTML/Documentation.html">http://cmake.org/HTML/Documentation.html</a> or run<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;cmake --help-command INCLUDE_DIRECTORIES<br>&gt;&gt;<br>&gt;&gt; for a complete description.
<br>&gt;&gt;<br>&gt;&gt; Regards,<br>&gt;&gt;<br>&gt;&gt; Gaetan<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; --<br>&gt;&gt; Gaëtan Lehmann<br>&gt;&gt; Biologie du Développement et de la Reproduction<br>&gt;&gt; INRA de Jouy-en-Josas (France)
<br>&gt;&gt; tel: +33 1 34 65 29 66&nbsp;&nbsp;&nbsp;&nbsp;fax: 01 34 65 29 09<br>&gt;&gt; <a href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</a><br>&gt;&gt;<br><br><br><br>--<br>Gaëtan Lehmann<br>Biologie du Développement et de la Reproduction
<br>INRA de Jouy-en-Josas (France)<br>tel: +33 1 34 65 29 66&nbsp;&nbsp;&nbsp;&nbsp;fax: 01 34 65 29 09<br><a href="http://voxel.jouy.inra.fr">http://voxel.jouy.inra.fr</a><br></blockquote></div><br>