2009/3/16 Matthew Woehlke <mw_tr...@users.sourceforge.net>: > Eric Noulard wrote: >> >> 2009/2/26 Alex Flint <alex.fl...@gmail.com>: >>> >>> 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". >> >> I think this already works if you call >> "make" >> and not >> "make foo" >> >> Because "existing target" do depends on "cmake_check_build_system" >> which should check for CMakeLists.txt changes (not verified just a guess). > > Actually, it's supposed to be possible to make the makefile itself dependent > on something.
You may be right but currently I do not see anything like a DIRECT dependency between Makefile and CMakeLists.txt in the CMake generated Makefile. The dependency exists (cmake_check_build_system) but it is somehow "lazy", that is it is checked if you try to build any **already existing** target and not when trying to build a new target freshly added to a CMakeLists.txt. > I think if this isn't working, either a: cmake isn't writing > optimal dependencies for the makefiles themselves, Optimal depends in which sense. With the current scheme I would say that dependency is checked "almost always when needed", with your propose scheme it would have to be checked "always even if not needed", I would bet that unconditionnally checking dependency for non-existing target may be "sub-optimal" because it may cost you many unneeded check for rare case of needed checks. I may be wrong, may be some CMake developer, expert in Unix Makefiles generator dependency may shed the light on this? > or b: 'make' could be doing better. I would say that make is an almost stupid tool, it does not check for unspecified dependency :-) Current CMake generated Makefiles lacks some rule like: Makefile : cmake_check_build_system My point of view is, I don't think it would be worth the cost to add it. -- Erk _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake