[CMake] automatically re-generating makefiles

Alex Flint alex.flint at gmail.com
Thu Feb 26 06:19:40 EST 2009


Hi there,

I've noticed that when I run "make blah" then the makefile is
automatically re-generated if I've changed anything in CMakeLists.txt
since the last time I built "blah". However, if I add a new target to
CMakeLists.txt then I have to run cmake manually or else I just get
"to rule to make foo". This makes perfect sense but I was wondering if
there is there any way to get cmake to put a catch-all rule in the
Makefile that will cause CMakeLists.txt to be re-read even if a
nonexistent target is specified on the commandline. Hence I would like
to be able to add a target "foo" to CMakeLists.txt then just run "make
foo" and cmake should be invoked to regenerate the makefile and the
makefile should be invoked. This might sound pointless but I actually
have a good motivation that I'd be happy to discuss if anyone is
interested...

Cheers,
Alex


More information about the CMake mailing list