All I have to say is that you all rocks :-)<br><br>
Brandon Van Every, excuse my ignorance but what documentation are you refering to ?<br>The cmake book ? I'm still student I can't afford a big book for a compilation system, even if it's the greatest.<br>Maybe a &quot;cmake quick guide&quot; book just under the &quot;mastering cmake&quot; book could be a good idea :)
<br><br><span style="text-decoration: underline;"><span style="font-weight: bold;"></span></span><font face="Arial, Helvetica, sans-serif" size="2"><font size="-2"><b><a class="HeaderText" href="javascript:document.masteringcmake.submit()">
<span style="font-weight: bold;"></span></a></b>
                     </font></font><div><span class="gmail_quote">On 12/15/06, <b class="gmail_sendername">Mike Jackson</b> &lt;<a href="mailto:mike.jackson@imts.us">mike.jackson@imts.us</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;">
<div style="">I am not going to tackle the point of how many CMakeLists.txt files you should have but I can tell you how to avoid all the CMake temp stuff..&nbsp;<div><br></div><div>This is how I set up my projects currently.</div>
<div><br></div><div>It looks as though we have similar arrangements of our source codes. So first, in your top level CMakeLists.txt file add the following AFTER the &quot;project()&quot; line but BEFORE the &quot;subdirs()&quot; line:
</div><div><br></div><div>#------ Setup output Directories ---------------------------------</div><div>SET (LIBRARY_OUTPUT_PATH</div><div><span style="white-space: pre;">        </span>${PROJECT_BINARY_DIR}/Bin</div><div><span style="white-space: pre;">
        </span>CACHE PATH</div><div><span style="white-space: pre;">        </span>&quot;Single Directory for all Libraries&quot;</div><div>)</div><div><br></div><div>#------ Setup the Executable output Directory ---------------------------------
</div><div>SET (EXECUTABLE_OUTPUT_PATH</div><div><span style="white-space: pre;">        </span>${PROJECT_BINARY_DIR}/Bin</div><div><span style="white-space: pre;">        </span>CACHE PATH</div><div><span style="white-space: pre;">        </span>
&quot;Single Directory for all Executables.&quot;</div><div>)</div><div><br></div><div>I am going to assume a unix/terminal environment. Make the adjustments to tools for XP.</div><div><br></div><div>Now, what you do is create a directory at the same level as the top level 
CMakeLists.txt file, call it &quot;Build&quot;. Now &quot;cd&quot; into the &quot;Build&quot; directory then run &quot;cmake ../&quot;. This will generate all the CMake files and other stuff _inside_ the Build directory thus keeping your source tree clean.&nbsp;
</div><div>Now type &quot;make&quot; in the same directory and your binaries will be built inside &quot;./Build/Bin&quot;.</div><div><br></div><div>This makes things very convenient when you want to submit your source to CVS or clean out all the built products. Just blow away everything inside &quot;Build&quot; and redo the cmake.
</div><div><br></div><div>I choose to do it this way because I use Eclipse with the CDT plugins to do C++ development. Eclipse/CDT works better if the built binaries are _within_ the project directory.</div><div><br></div>
<div>Kitware and others may tell you to do a true &quot;out of source&quot; build which means that you would create a directory at the same level as your main project directory, lets call it &quot;test-build&quot;, and then from within &quot;test-build&quot; do a &quot;cmake ../test&quot;. This is absolutely valid way to do things and depending on the size of your project may be preferable. I can not image using my method on a project like ParaView or VTK. It would work, but with a project _that_ large I would want to keep the project directories and the build directories distinctly separate.
</div><div><br></div><div>Good Luck.</div><div><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Bitstream Vera Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div style="margin: 0px;">--&nbsp;</div><div style="margin: 0px;">Mike Jackson &nbsp; Senior Research Engineer</div><div style="margin: 0px;">Innovative Management &amp; Technology Services</div><br></span> </div><br><div><div><span class="e" id="q_10f8662cee8caa14_1">
<div>On Dec 15, 2006, at 8:26 AM, Mehdi Rabah wrote:</div><br></span></div><blockquote type="cite"><div><span class="e" id="q_10f8662cee8caa14_3">Hi everyone,<br><br>I'm new to cmake, and there's something simple I don't know how to do.
<br>Here what I wrote in CMakeLists.txt so far:<br><br>project(test)<br>subdirs(src)<br><br>and in src directory I have another CMakeLists.txt :<br><br>add_executable(testApp Applications/testApp.cpp) <br><br>and what I want is that the compilation result of 
testApp.cpp goes into the ./bin directory, but by default it goes into ./src<br>I use ccmake to set it to go to the bin directory, but when I run the compilation the makefile create a src/bin and use it. <br><br>How to set cmake so it write the binary in ./bin ?
<br>Also, in src I have a lot of temporary files (cmake_install.cmake, CMakeFiles, ...), how can I avoid having this in my subdirectories ? Should I write one only CMakeLists.txt in the root directory ?<br><br>Regards,<br>
<br>Mehdi<br><br><br></span></div><div style="margin: 0px;">_______________________________________________</div><div style="margin: 0px;">CMake mailing list</div><div style="margin: 0px;"><a href="mailto:CMake@cmake.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
CMake@cmake.org</a></div><div style="margin: 0px;"><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cmake.org/mailman/listinfo/cmake</a>
</div> </blockquote></div><br></div></div>
</blockquote></div><br>