[Cmake] separate compiling and linking

William A. Hoffman billlist at nycap.rr.com
Tue, 27 Apr 2004 12:12:16 -0400


You would have to create the dummy targets.
A change checked in last night to cvs may be a better
solution.   It makes cmake use the directory name
of the source file in the object name.  That way
you could have the same name .c or .cpp file in a sub directory
but still put them into the same ADD_LIBRARY call.

So, I think something like this will be your best bet:

INCLUDE(dir1/dir1rules.cmake)
INCLUDE(dir2/dir2rules.cmake)
ADD_LIBRARY(BigLib ${DIR1_SRCS)  ${DIR2_SRCS})


-Bill


At 11:33 AM 4/27/2004, Iker Arizmendi wrote:
>How does one create the .o files to
>begin with? Is there a separate command like
>
>  ADD_OBJECT(source.o source.cpp)
>
>that I can use to generate object files
>portably? Or is there a need to create a
>"dummy" target (a library or exe) that will
>generate them?
>
>Iker
>
>
>William A. Hoffman wrote:
>>As long as you made sure to use the ADD_DEPENDENCY command between
>>libraries, it should work.  You may want to try it with cvs cmake and
>>let us know if it does work.
>>
>>-Bill
>>
>>At 10:15 PM 4/26/2004, Iker Arizmendi wrote:
>>
>>>Sorry, what I meant to ask is how would this
>>>feature be used? If its something like so:
>>>
>>> ADD_LIBRARY(mylib source1.cpp source2.o)
>>>
>>>that still leaves open the question of how to
>>>generate source2.o. Wouldn't this require
>>>additional keyword support to generate
>>>standalone object files?
>>>
>>>Iker
>>>
>>>
>>>William A. Hoffman wrote:
>>>
>>>>>P.S.
>>>>>What's the syntax for adding .o files under
>>>>>CVS Cmake?
>>>>
>>>>Same as adding a .c or .cpp file.
>>>>
>>>>-Bill
>>>
>>>-- Iker Arizmendi
>>>AT&T Labs - Research
>>>Speech and Image Processing Lab
>>>e: iker at research.att.com
>>>w: http://research.att.com
>>
>
>
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake