[CMake] seperate source/build directories (Was: cleaning targets)

Michael Jackson mike.jackson at bluequartz.net
Thu Nov 6 17:09:33 EST 2008


On Nov 6, 2008, at 4:15 PM, Eric (Brad) Lemings wrote:

> Eric Noulard wrote:
>> 2008/11/6 Michael Jackson <mike.jackson at bluequartz.net>:
>>
>>> All this is asking is 2 extra commands.
>>>
>>
>> You may perfectly do that with autotools too:
>>
>> mkdir build
>> cd build
>> /path/to/source/configure
>> make
>> make install
> Right.  And because with autotools, the build process works as well in
> the source tree, in a build subdirectory, or completely separate build
> directory, no particular approach is preferred over another.
>
> If CMake recommends one approach (or avoiding another), this implies  
> it
> doesn't work well (or as well) with that approach because of
> shortcomings in the tool rather than "it's good development practice".
> Or maybe its both?
>
> Eric.

Well, sometimes we developers need a gentle "push" to change to "good  
development practices". I think CMake works just as well with in  
source as out of source builds. Out of source builds are just easier  
to clean up if something goes wrong. Both autotools and cmake can both  
be abused so that make distclean do not get every thing cleaned up. I  
really just boils down to the developer who created the projects.

   The CMake community does face an "uphill battle" with regards to  
"configure, make, make install" mentality that is ingrained in long  
time unix users. I guess I would rather have a tool that works 100% of  
the time in its recommended configuration rather than a set of tools  
where I have to second guess the developer and always ask myself " did  
they remember to clean 'all' the files?" or "How do I put my source  
directory back to the way it was?" With CMake if the build goes wrong  
and I want to start completely blank and NOT have to worry about  
deleting actual project files, then removing 1 single directory is  
about as easy as it gets.

Just my 2 or 3 cents worth.

Mike


More information about the CMake mailing list