[CMake] Simclist library produces simclist.c.o, simclist.c.i, simclist.c.s ...
SC
robot.conversion at wanadoo.fr
Fri Sep 17 10:23:21 EDT 2010
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.
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 ?
> Michael's exactly right. We consider the name and location of the object
> files to be an implementation detail of CMake (and it's different on
> different systems with different compilers....) -- you cannot rely on those
> details being exactly the same from version to version of CMake. Especially
> not versions that are spaced *years* apart from each other.
I understand. Nevertheless Cmake users need to know the name of the files generated when building with the CMake
generated file. IMHO, changing output file names from a Cmake to a revision of Cmake can just break build chain.
Risking this to avoid conflicting sounds odd to me.
Well I got the point, I suspect I'll change my static link to simclist.c.o. Guess it's the best thing to do, right ?
Thanks !
More information about the CMake
mailing list