[CMake] Xcode generator?

Robert Dailey rcdailey at gmail.com
Thu Apr 16 20:44:25 EDT 2009


On Thu, Apr 16, 2009 at 7:25 PM, Bill Hoffman <bill.hoffman at kitware.com>wrote:

> Robert Dailey wrote:
>
>> What do you mean "specified order"? Why does the order of static libraries
>> matter? And also what do you mean by "repeats"?
>>
> Linkers on unix (including apple) require that the order of static
> libraries be specified in order of symbol usage.   Sometimes this requires a
> library to be repeated more than once on the link line, like -lA -lB -lA.
>  If A and B are Xcode static libraries, and you have executable C that uses
> them, there is no way in Xcode other than raw linker commands to get it to
> use -lA -lB -lA.  So, CMake uses -lA -lB -lA all the time.  The problem
> comes in because you can not put external depends on a C in Xcode.  So, we
> use a helper makefile to remove C if A or B changes.   It is really
> horrible, but at least Xcode provided a way to get around the problem using
> makefiles....


Thanks for explaining Bill. What you've just explained is very confusing to
me. What I'm trying to do is investigate CMake a bit more so we can get it
working for the iPhone. However, what you've just brought up I still have a
few more questions about but to ask them would be getting a bit off-topic
from CMake itself. I need to figure out why the linker would require library
A to be linked in twice, and perhaps the best way to do this is to look at
an existing project that actually specifies a library to be linked multiple
times.

As a final request (again, to avoid going off-topic), I would really
appreciate it if you could reference me to any reading materials on this
subject. Perhaps if Xcode does not allow a single library to be added
multiple times means that not every library must be linked against more than
one time regardless of the result of flattening the dependency tree?

Again, thanks for the help Bill. I've been primarily stuck on Windows as a
developer and I'm not familiar with such a linker requirement.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090416/e5166d45/attachment-0001.htm>


More information about the CMake mailing list