[CMake] Possible to clean files of one target library only?

Jörg Förstner Joerg.Foerstner at ubidyne.com
Fri Aug 21 13:12:42 EDT 2009


> > Hi,
> > 
> > if I execute 'make clean', then all object files of the 
> whole project 
> > are removed.
> > 
> > Now I would like to clean only object files belonging to one 
> > target/library, to force rebuilding this library.
> > How can I do this?
> > 
> > Best Regards,
> > Joerg
> > 
> 
> If you are using CMake to generate makefiles, you can run 
> "make clean" 
> in a subdirectory of your build tree, and make will only remove the 
> files for that directory - you can use this to do library-specific 
> cleaning, provided that you've organized your sources so each library 
> has its own directory.
> 
> Cheers,
> Tim
> 

You are completely right, that's the way it works - cd into a subdirectory and execute "make clean" there.
Then this cleaned folder/library builds again.
Thank you.

Cheers,
Jörg


More information about the CMake mailing list