On 17. Sep, 2010, at 16:50 , Eric Noulard wrote: > 2010/9/17 SC <robot.convers...@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
PGP.sig
Description: This is a digitally signed message part
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake