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

Tyler Roscoe tyler at cryptio.net
Wed Aug 19 12:09:47 EDT 2009


On Wed, Aug 19, 2009 at 03:12:39PM +0200, Jörg Förstner wrote:
> 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?

If you add /fast to a target name "make myTarget/fast", it builds that
target without worrying about its dependencies (like "Build only this
project" in Visual Studio).

I thought "make clean/fast" was supposed to work but it looks like it
doesn't. That target does exist but I guess I don't understand its
purpose since it cleaned everything in my build tree.

You might be able to remove the relevant myTarget.dir directory to get
the same effect. You may have to rerun CMake after you do this; I'm not
sure.

tyler


More information about the CMake mailing list