[CMake] Re: Custom build step
pepone.onrez
pepone.onrez at gmail.com
Mon Jan 21 12:10:56 EST 2008
>On Jan 21, 2008 7:40 AM, Brandon Van Every <bvanevery at gmail.com> wrote:
>This fails because add_library only understands target level
>dependencies. add_custom_command only generates file level
I think there is an inconsistence in the way ADD_CUSTOM_COMMAND run and how
dependencies are managed, but also this my be same misunderstanding of me.
If i generated my files in one ADD_CUSTOM_COMMAND make don't report any
problems and project builds fine, all dependencies are found.
When i try to split the generation process in multiple custom_commands it
don't generate the correct targets. Even when one command depends on the
other and the library depends on the output files from the second command.
make reports that there isn't a target for the second one.
When i try to resolve with ADD_DEPENDECIES ,ALL targets are found but the
generation code runs two times each time i run make (I think this is
expected with ADD_DEPENDENCIES because doc says is considered always out of
date).
When i try to resolve with
ADD_CUSTOM_COMMAND(TARGET MyLib PRE_BUILD DEPENDS ${GeneratedFiles})
Cmake runs with out erros but make reports that there is no target for
generate ${GeneratedFiles} that is the output of my second command. The
same as when i use 2 ADD_CUSTOM_COMMAND with out ADD_DEPENDENCIES.
Thanks in advance any help is appreciated.
On Jan 21, 2008 5:14 PM, pepone. onrez <pepone.onrez at gmail.com> wrote:
> Hi Brandon thanks for your help
> problem with ADD_CUSTOM_TARGET is that runs allways even when it generate
> files are up to date.
>
> Quoted From Cmake docs:
>
> Adds a target with the given name that executes the given commands. The
> target has no output file and is ALWAYS CONSIDERED OUT OF DATE even if the
> commands try to create a file with the name of the target.
>
> In my case now the commands that generated the files now run tow times. I
> now trying with ADD_CUSTOM_COMMAND(TARGET foo PRE_BUILD) with out success at
> this point.
>
>
>
>
>
> On Jan 21, 2008 2:41 PM, Brandon Van Every <bvanevery at gmail.com> wrote:
>
> > On Jan 21, 2008 8:39 AM, Brandon Van Every <bvanevery at gmail.com> wrote:
> > >
> > > then ADD_DEPENDENCIES(mylib DEPENDS blah).
> >
> > Er, add_dependencies(mylib blah).
> >
> >
> > Cheers,
> > Brandon Van Every
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080121/6b54386c/attachment.html
More information about the CMake
mailing list