[CMake] Simclist library produces simclist.c.o, simclist.c.i, simclist.c.s ...
Michael Wild
themiwi at gmail.com
Sat Sep 18 01:20:12 EDT 2010
On 17. Sep, 2010, at 16:50 , Eric Noulard wrote:
> 2010/9/17 SC <robot.conversion at wanadoo.fr>:
>> David, Michael,
>>
>> Thank you for your help. [David, sorry for this double mailing to you]
>>
>>>> No, this is intentional, I suspect to avoid conflicts. There are people
>>>> doing stuff like
>>>> add_library(foo foo.c foo.cpp foo.f)
>>>> Why is this a problem for you?
>> Right, I understand the point of view of the CMake implementation. My problem is that my project statically links
>> the .o object file, hence the linker looks explicitly for simclist.o, and since the file doesn't exist anymore, the
>> link fails. I understand compiling foo.c and foo.cpp will both generate foo.o, which obviously will conflict. But
>> who does this ? This is weird isn't it ? It looks like walking on one's foot to me !
>>
>> Of course I could alter my project's Makefile so that to reflect to simclist.o -> simclist.c.o change. Doing this
>> also means that eventually, in a few years, I might come through the same kind of issue if Cmake generates not
>> simclist.c.o but simclist.c.X.o or even simclist.o : I'd need to change my project's makefile again so that I link
>> with simclist.c.X.o or simclist.o.
>
> Why are you talking about Makefile?
> Common usage of CMake is to avoid writing any Makefile?
>
> With CMake you write CMakeLists.txt and CMake generates the makefiles for you.
Eric, I suspect that he's not a CMake user, he's a user of a CMake-based project ;-)
>
> Concerning your static link you could build a static lib.
>
Agreed, although that might require patching of the upstream project's CMakeLists.txt.
>
>> I'd expect a way to force output file name. What's your opinion ? If you were me, would you go into changing my
>> project Makefile ?
>
No, you shouldn't use the raw object files in the first place. As said above, you should build a static library and then link against that.
> Like I said you shouldn't be writing a "Makefile" unless you are
> speacking about CMakeLists.txt.
See above.
Michael
--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100918/ab68ad57/attachment.pgp>
More information about the CMake
mailing list