cmake cvs head - dependencies broken
David Faure
faure at kde.org
Fri Feb 22 16:45:56 CET 2008
On Friday 22 February 2008, Brad King wrote:
> David Faure wrote:
> > Sorry, me again :)
> >
> > With cmake cvs from today, when I modify a header file, the corresponding .cpp file (which obviously includes it)
> > doesn't get recompiled !?!?
> >
> > I tried touching the CMakeLists.txt in that dir, I tried forcing a recompile of foo.cpp
> > (to let it recompute dependencies if that's when it happens),
> > but after that the same happens: changing the header file triggers no recompilation.
>
> I cannot reproduce this. Everything rebuilds correctly for me.
>
> Did you start with a fresh build tree or run CMake from CVS on a tree
> initially generated by 2.4?
It was an old tree indeed (that's why I tried forcing stuff but it didn't help).
> What generator are you using?
Makefiles.
> If you're using the Makefiles generator, look in the build tree under
> "CMakeFiles/<target-not-rebuilding>.dir". There should be files like
> "depend.make" and "CXX.includecache". Please send them to me.
CMakeFiles/kdecore.dir/depend.make is empty ("# Empty dependencies files, # This may be replaced when dependencies are built")
CXX.includecache is up at http://web.davidfaure.fr/tmp/CXX.includecache (strange syntax, is the "target" the first line after an empty line?)
My testcase is:
touch sycoca/ksycocafactory.h ; make
and I see
[ 0%] Generating kdecore_automoc.cpp
[ 0%] Building CXX object kdecore/CMakeFiles/kdecore.dir/kdecore_automoc.cpp.o
Linking CXX shared library ../lib/libkdecore.so
instead of
makeobj[0]: Entering directory `/d/kde/build/4/kdelibs/kdecore'
[ 0%] Generating kdecore_automoc.cpp
[ 0%] Building CXX object kdecore/CMakeFiles/kdecore.dir/kdecore_automoc.cpp.o
[ 0%] Building CXX object kdecore/CMakeFiles/kdecore.dir/sycoca/ksycocafactory.cpp.o
[and plenty others]
Linking CXX shared library ../lib/libkdecore.so
> Can you reproduce it in a new build tree?
OK, that was it.
I deleted the kdecore build dir and ran cmake again, and now it works as expected.
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/services/kmimetype.cpp.o".
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/services/kmimetypefactory.cpp.o".
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/services/kmimetypetrader.cpp.o".
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/services/kservice.cpp.o".
[...]
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/sycoca/ksycoca.cpp.o".
Dependee "/d/kde/src/4/kdelibs/kdecore/sycoca/ksycocafactory.h" is newer than depender "kdecore/CMakeFiles/kdecore.dir/sycoca/ksycocafactory.cpp.o".
and then it works fine.
Maybe cmake could do like Qt's moc and say "this build tree was generated with cmake-2.4, you need to delete it and regenerate it to use this version of cmake" or something like that?
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the Kde-buildsystem
mailing list