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

Michael Jackson mike.jackson at bluequartz.net
Wed Nov 23 15:25:07 EST 2016


Thanks! This worked for my needs. Ninja said my command line changed. So 
I used the generated compile_commands.json before and after a cmake run, 
diff'ed those two files and was able to zero in on the issue. Thanks for 
the tip. Worked great. Have to store that one away for future use.

-- 
Mike Jackson  [mike.jackson at bluequartz.net]


Craig Scott wrote:
> Does "ninja -d explain" tell you what you need?
>
> On Thu, Nov 24, 2016 at 5:34 AM, Michael Jackson
> <mike.jackson at bluequartz.net <mailto: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
>     <mailto:mike.jackson at bluequartz.net>]
>     --
>
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Please keep messages on-topic and check the CMake FAQ at:
>     http://www.cmake.org/Wiki/CMake_FAQ
>     <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
>     <http://cmake.org/cmake/help/support.html>
>     CMake Consulting: http://cmake.org/cmake/help/consulting.html
>     <http://cmake.org/cmake/help/consulting.html>
>     CMake Training Courses: http://cmake.org/cmake/help/training.html
>     <http://cmake.org/cmake/help/training.html>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>     <http://www.kitware.com/opensource/opensource.html>
>
>     Follow this link to subscribe/unsubscribe:
>     http://public.kitware.com/mailman/listinfo/cmake
>     <http://public.kitware.com/mailman/listinfo/cmake>
>
>
>
>
> --
> Craig Scott
> Melbourne, Australia
> https://crascit.com


More information about the CMake mailing list