On Friday, September 26, 2014 01:53:35 Stephen Kelly wrote: > Alexander Neundorf wrote: > >> I don't see why the target is executed each time, but is it that way by > >> design? > > > > iirc, yes. > > The moc files have to be generated before any of the source files is > > compiled, so automoc is in a target the actual target depends on. > > IIRC it is exclude_from_all so that it is only built when the actual > > target is built. > > Do you think it should only rerun if any of the source files has changed ? > > There was some problem with this. > > The headers are usually not part of the listed source files. > > Hmm, well, we do know which header is relevant right? Because it's the one > (or many) we set up commands to run moc on. Maybe we only know the relevant > headers too late (at the time of running the -E cmake_autogen command, not > at cmake time)? > > Something else I've wondered is why the parsing of the files is done > 'delayed' with the -E cmake_autogen command. Is it just to avoid doing that > task during cmake time (because it's time consuming), and to allow > parallelization?
it can't be done at cmake time, because editing a cpp file and inserting #include "foo.moc" does not cause cmake to rerun, so the parsing must happen during buildtime. Alex -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers