My current work in progress on this problem can be found at:
https://github.com/robertmaynard/CMake/tree/ninja_phony_file_targets




On Thu, Apr 4, 2013 at 8:20 AM, Brad King <brad.k...@kitware.com> wrote:

> On 04/04/2013 07:57 AM, Peter Kümmel wrote:
> > On 02.04.2013 15:19, Brad King wrote:
> >>   build libA.a: C_STATIC_LIBRARY_LINKER CMakeFiles/A.dir/a.c.o
> >>     POST_BUILD = cd ".../build" && cp .../a.c a.txt
> >
> > In build.ninja is no rule for coping a.c to a.txt at all.
> > Seems support for add_custom_command(TARGET) is missing or broken.
>
> No, the CMakeLists.txt code I posted does not even tell CMake
> that any particular rule generates a.txt.  The expectation is
> that by the time the rules for CMake target B are evaluated the
> file will have been created due to the order-dependency of B on A.
>
> All the other (Makefiles, VS, Xcode) produce build systems that
> evaluate file-level dependencies inside each main CMake target
> separately.  Ninja has a monolithic file so it needs additional
> work to achieve this.  The solution Robert proposed is to add
> rules like
>
>  build a.txt : phony a.txt
>
> for all the file-level dependencies located in the build tree
> for which there is no custom command output.  That may convince
> Ninja to skip complaining about the missing explicit dependency.
>
> -Brad
> --
>
> 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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>



-- 
Robert Maynard
--

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://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to