As a counter example (which perhaps could be improved on), we are currently 
putting our generated cmake files in the build tree. The reason for this to 
allow git post-checkout and post-rewrite hooks to updating the build files if 
needed. We have  python script that rewrites the files if they would be 
different, but otherwise doesn't touch them. It is run by cmake as well as by 
git. 


On Jun 13, 2013, at 5:41 AM, William McKenzie <[email protected]> wrote:

> It's nice when everyone agrees.
> 
> thanks
> 
> 
> On Wed, Jun 12, 2013 at 2:49 PM, Matthew Woehlke 
> <[email protected]> wrote:
> On 2013-06-12 15:30, William McKenzie wrote:
> Just wondering what the common convention is here. If I have some generated
> c/c++ source files, say from gSoap or Lex/Yacc (and my build rules take
> care of the generation), is the convention to generate these into the build
> folder, or the original source folder? I understand I could use either, and
> in some ways it makes more sense for them to go into the build folder. But
> it also feels a little weird that all of my c files are not in the same
> place if I do that.
> 
> Build directory. Configuring and building should never, ever alter the source 
> directory in any way. (It should be possible, even, to configure and build 
> successfully if the source directory is mounted read-only.)
> 
> Basically, generated artifacts of any kind should be kept separate from 
> non-generated, for several reasons:
> 
> - Makes version control much easier.
> 
> - Can get back to 'pristine' state simply by removing the build directory.
> 
> - Can have multiple builds with different configurations (or even compilers) 
> sharing a single source directory.
> 
> - Can ensure integrity of the source tree by making it immutable (see above 
> ;-)... not that I tend to do this, but it's still good to have the ability if 
> needed).
> 
> -- 
> Matthew
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to