[CMake] dependlocal problem

Alexander Neundorf a.neundorf-work at gmx.net
Wed Feb 23 17:44:28 EST 2005


Hi,  
  
> Alexander Neundorf wrote:  
> > I'm trying to build kdevelop with cmake and wrote some new macros.  
> > Now I  
> > see the following: when starting make in the kdevelop root directory,  
> > it traverses and builds as expected, but it seems for dependlocal it  
> > starts make for every file. Is this expected behaviour ?   
> > The result you see below, this takes quite long (more than 1 minute  
> > just the dependlocal) on a fast machine (2GHz).   
> >    
> > make[7]: Entering directory  
> `/home/src/kde3-HEAD/kdevelop_3_3_branch/tmo/  
> > kdevelop/lib/widgets/propeditor'   
> > Building dependencies. cmake.depends...   
> > /usr/local/bin/cmake -S/home/src/kde3-HEAD/kdevelop_3_3_branch/tmo/  
> > kdevelop/lib/widgets/propeditor -O/home/src/kde3-HEAD/  
> > kdevelop_3_3_branch/tmo/kdevelop/lib/widgets/propeditor -H/home/src/  
> > kde3-HEAD/kdevelop_3_3_branch/tmo/kdevelop -B/home/src/kde3-HEAD/  
> > kdevelop_3_3_branch/tmo/kdevelop   
> > make[7]: Leaving directory `/home/src/kde3-HEAD/kdevelop_3_3_branch/ 
tmo/  
> > kdevelop/lib/widgets/propeditor'   
> > make  cmake.check_depends   
>   
> You can run make like this to try to identify why all the extra makes   
> are being run:  
>   
> make -d -r VERBOSE=1 >make.log 2>&1  
  
Thanks for the hint.  
I attached a cmake.check_depends file. I think it shows the problem.  
It contains a lot of rules like:  
  
/home/src/kde3-HEAD/kdevelop/lib/interfaces/KDevCoreIface.moc:  
	$(MAKE) $(MAKESILENT) dependlocal  
  
These moc-files are included in the cpp files:  
  
foo.cpp  
void Foo::bar() {  
   printf("hello bar\n");  
}  
  
#include "foo.moc"  
  
with foo.h something like this:   
  
class Foo:public QWidget {  
   Q_OBJECT  
   public slots:  
      void bar();  
}  
  
  
So when make enters the directory and wants to build foo.o, it sees that  
foo.cpp depends on foo.moc, and foo.moc forces dependlocal. make  
dependlocal takes a noticable moment to execute. foo.moc is created from  
and depends on foo.h (as specified in the ADD_CUSTOM_COMMAND()).  
For a directory with a lot of such moc files this adds up significantly.  
  
What could be done to improve this situation ?  
Maybe not create the dependlocal for files which are generated ?  
  
Bye  
Alex  
  

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

-- 
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake.check_depends
Type: text/x-makefile
Size: 26251 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20050223/6c7a890a/cmake-0001.bin


More information about the CMake mailing list