On 30 November 2015 at 18:35, Brad King <brad.k...@kitware.com> wrote:
> On 11/30/2015 01:32 PM, Dan Liew wrote:
>> It works but only for makefile generators... That's an annoying
>> limitation. I'll file a feature request to get this implemented for
>> other generators.
>
> It happens to work for Makefile generators because it was easy to
> implement since those generators already do their own scanning.
> For other generators it is not possible to implement.

Well I found the open issue [1]. It's been open for a while.

It doesn't look completely impossible. For Ninja, it looks like it has
some support for compiler
generated dependency files [2]. Incorporating that into
``add_custom_command()`` would require
an extra call to the host compiler to generate the dependencies when
the custom command is invoked.

For other generators that are Makefile or Ninja based I guess that
approach wouldn't work.

There is an alternative which I suggested in the post. Have CMake
determine the dependencies of the files passed to ``IMPLICIT_DEPENDS``
at configure
time and spit that into the build files of the generator (that would
work for any generator). Then have any changes made to the files
passed to ``IMPLICIT_DEPENDS``
trigger a reconfigure so that the dependencies can be recomputed. For
Makefiles you can don't need to do this and can take the "fast path"
instead.

[1] https://cmake.org/Bug/view.php?id=13234
[2] https://ninja-build.org/manual.html#_depfile

Dan.
-- 

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

Reply via email to