[Cmake] separate compiling and linking
Iker Arizmendi
iker at research.att.com
Mon, 26 Apr 2004 16:42:46 -0400
That's great - direct support for .o files will
be really handy. In the meantime, I'll have to
make do with several libs since each of the
subdirectories may have irregularly ways of
generating object files (custom input files that
generate custom .c or .cpp files at build time)
Thanks again,
Iker
P.S.
What's the syntax for adding .o files under
CVS Cmake?
William A. Hoffman wrote:
> This can not be done in 1.8, but cvs cmake can add .o files as part
> of the build. You could not find the .o files from cmake, but
> you could generate the list of names from the source list.
> Since cmake is not actually doing the builds, there is no way
> for cmake to glob the .o files as they will not exist until cmake
> is long gone. So, you would have to create them yourself:
>
> SET(SOURCES foo.cxx;bar.cxx)
> FOREACH(s ${SOURCES})
> STRING(REGEX REPLACE ".cxx" ".o" obj ${s})
> SET(OBJS ${OBJS};${obj})
> ENDFOREACH(s)
>
> Then add the dummy libraries, and use ADD_DEPENDENCY to make
> sure that the dummy libraries get built before the end library, and
> it might work....
>
>
> Of course, you will have to be careful about .obj and .o.
>
> -Bill
>
>