[CMake] Determine which files have changed during a CMake run

David Cole DLRdave at aol.com
Wed Nov 23 15:12:09 EST 2016


Using git like that is actually the perfect way to do it if you just want
to analyze it manually. I've actually done that with other projects source
trees when something seems to appear there even when doing an out of source
build... It's a great way to see what's changed (and how) easily.

You could also write a CMake script that iterates files in the build
directory, and uses IS_NEWER in conjunction with a reference file touched
just prior to running CMake if you need to generate a report like this
frequently for some reason.

HTH,
David C.


On Wednesday, November 23, 2016, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> Is there a way to determine which files in my build directory have changed
> for a given run of CMake? The use case is that I made what I thought was a
> small change to my configuration using cmake and when I went to build it
> was basically a full recompile. During our cmake run we do use
> configure_file(...) to generate headers and sources some of which basically
> get included in every source file. I am thinking that I have a dependency
> on generating those files when I probably do not have to.
>
> I use Ninja as my build system if that helps. I could always just hack a
> local git repo for the build folder, commit everything, run cmake and see
> what got changed. Anybody have a better idea?
>
> Thanks
>
> --
> Mike Jackson  [mike.jackson at bluequartz.net]
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161123/91647e92/attachment.html>


More information about the CMake mailing list