[CMake] how to compile single source file with debug options?

Sergey Spiridonov sena at hurd.homeunix.org
Fri Jun 10 08:05:31 EDT 2016


Hello all,

We have big project with lots of libraries and applications. We want to
switch to cmake. Currently we use our own build system, which is derived
from tmake.

To debug and fix our applications/libraries we often need to recompile
single source file in a debug mode. With the our current build system it
is as simple, as touching a file an starting make with debug option. It
will then recompile that single file with -O0 -g and with -DDEBUG and
relink target application/library.

How it would be possible in cmake? We found out how to do that for the
single directory (library or application). But recompiling whole
library/application just for single file is too slow.

This is really a show-stopper for us.
-- 
Best regards, Sergey Spiridonov



More information about the CMake mailing list