[CMake] can I create all/fast target?

Daniel Nelson torham at connect2.com
Mon Aug 16 10:43:33 EDT 2010


On Monday 16 August 2010 7:47:33 am naryniecki wrote:
> Hi,
> 
> I only want add that when I run "make t1/fast t2/fast" from command line it
> works fine.
> 
> Dnia 16 sierpnia 2010 15:33 naryniecki <naryniecki at o2.pl> napisał(a):
> > Hi,
> > 
> > for each target in Makefile generated by cmake there is another target
> > without scanning dependencies. for example for target Radio there is
> > Radio/fast. dependencies scanning take half of time in our building
> > process. And we need to be able to rebuild everything as fast as
> > possible. but there is no all/fast target. We have to much targets to
> > put them all in command line with /fast added. I tried to create custom
> > target which depends on all other /fast targets. like:
> > add_custom_target(ALL_FAST DEPENDS t1/fast t2/fast) but when I try to
> > build ALL_FAST I get that there is no target t1/fast although "make
> > t1/fast" works fine. How can I do it?
> > 
> > br,
> > Marek

I'm not sure if you can make a fast version of the all target, but one of the 
things I have done on my project that has helped a lot is removing system  
from the dependency scanning.  You can do this with the 
INCLUDE_REGULAR_EXPRESSION command, however it can be a little hard to use 
since you need a regular expression that matches everything you want to 
include.  It also doesn't include the surrounding <> or "" as part of the 
expression which would make it easier to remove the system includes.

I ended up patching my build of cmake so that I could set a variable that 
removed all the includes that used <> from the dependency scanning.  This 
decreased my build times substantially.  I'll attach the patch which I believe 
is against version 2.8.1, if you use it just do this to turn it on: 
set(CMAKE_EXCLUDE_SYSTEM_INCLUDES ON)
--
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exclude_system_includes.patch
Type: text/x-patch
Size: 2590 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100816/972b95ae/attachment.bin>


More information about the CMake mailing list