[PATCH] make ADD CUSTOM COMMAND() work with relative paths was: Re: [CMake] behaviour change in MakefileGenerator3

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jul 8 10:55:55 EDT 2005


Hi,

the attached patch makes ADD_CUSTOM_COMMAND() work again with the makefile
generator v3 if the source or depend files are given with relative (or no)
paths. See the rest of this thread for details and a testcase.
It's done similar to the change in cmConfigureCommand.cxx

Bye
Alex


> --- Ursprüngliche Nachricht ---
> Von: "Alexander Neundorf" <a.neundorf-work at gmx.net>
> An: Brad King <brad.king at kitware.com>
> Kopie: cmake at www.cmake.org
> Betreff: Re: [CMake] behaviour change in MakefileGenerator3
> Datum: Thu, 7 Jul 2005 23:10:46 +0200 (MEST)
> 
> > Von: Brad King <brad.king at kitware.com>
> ...
> > >>Not sure. 
> > >>I attached a simple testcase. 
> > >>If you look in cmake-acc/foo/CMakeLists.txt, you will see an 
> > >>ADD_CUSTOM_COMMAND() which depends on config.h . It doesn't find 
> > >>cmake-acc/foo/config.h, but instead uses cmake-acc/config.h (which is
> > not 
> > >>what I would expect). Just remove the ${CMAKE_CURRENT_XXX_DIR}s in 
> > >>cmake-acc/foo/CMakeLists.txt too see what I mean. (cmake cvs june
> 29th, 
> > >>unix makefile generator). 
> > >> 
> > >>Bye 
> > >>Alex
> > > 
> > > 
> > > If I have in foo/CMakeLists.txt the following command:
> > > 
> > > ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/config.c
> > > COMMAND cp
> > > ARGS config.c.in config.c
> > > DEPENDS config.h)
> > > 
> > > the following rule is produced:
> > > 
> > > foo/config.c: config.h
> > > foo/config.c: foo/hello.dir/config.c.build.make
> > >         @echo "Generating config.c"
> > >         cd /usr/home/alex/src/cmake-acc/foo && cp config.c.in config.c
> > > 
> > > IMO obviously foo/config.c should depend on "foo/config.h" instead of
> > only
> > > "config.h". This is how it was up to UnixMakefileGenerator2.
> > 
> > I just tried this and I think it has been fixed.  I get a dependency on 
> > foo/config.h.
> > 
> > -Brad
> 
> It doesn't seem so.
> If you look in cmake-acc/foo/CMakeLists.txt, you will see that in
> ADD_CUSTOM_COMMAND() config.h is prefixed with
> ${CMAKE_CURRENT_SOURCE_DIR}.
> Without this it still fails and it generates a dependency to config.h
> (instead of foo/config.h)
> 
> Bye
> Alex
> 
> P.S. very cool that configure_file() works now as expected :-)
> 
> -- 
> 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
> +++ GMX - die erste Adresse für Mail, Message, More +++
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 

-- 
Weitersagen: GMX DSL-Flatrates mit Tempo-Garantie!
Ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmAddCustomCommandCommand.cxx.patch
Type: application/octet-stream
Size: 1717 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20050708/c5f7ac47/cmAddCustomCommandCommand.cxx.obj


More information about the CMake mailing list