[Cmake] RE: cmake RFC
William A. Hoffman
bill.hoffman at kitware.com
Wed May 1 07:54:43 EDT 2002
At 11:34 AM 5/1/2002 +0100, Geoffrey Cross wrote:
>Can someone answer this (I'm a windoze user now):
>
> > Having used CMake for about a day now, I can summarize a few
> > IMO fairly fundamental flaws in the UNIX makefile generator :
> >
> > 1) The flags passed to the to select static/dynamic linking
> > are determined in a hand-edited configure file in the CMake
> > distribution, and are wrong for Linux at least.
> >
Can you be more specific about what is wrong? CMake is working on many
platforms
including many varieties of linux. I am pretty sure that c++ -shared *.o
is the way to build
a shared library on linux.
> > 2) A typical release build will require some libraries to be
> > linked statically (vxl,libstdc++) and others dynamically
> > (GL,X,libm,libc). Apart from the linker flags being wrong,
> > there is no mechanism for this split into "local" and
> > "system" libraries. Consequently, hand-editing of link-lines
> > is necessary to make release builds.
> >
I am not sure how to fix this. Do you have any suggestions?
For releases here, I usually create a directory with symbolic links to the
static
libraries I need to link, and add that to the link path. I guess you can
do -static -shared around libraries. What do you suggest?
> > 3) The c++ compiler is used as the linker, meaning that
> > libstdc++ is always linked dynamically, which is bad.
> >
This is required for C++ code. If you do not use C++ for the linker, global
constructors are not called properly.
> > 4) There is no uniqifying of libraries on the link-line, so I
> > get cases where each library appears five or six times. I
> > guess this is hard to fix if there is no dependency engine to
> > determine the correct ordering. This makes the hand-editing
> > required in gripe 2 even more tedious.
This is a problem with vxl and how it uses cmake. cmake does duplicate
the libraries
twice, so that most of the time users do not have to worry about link order
for static links
vs. shared links. However, vxl, causes much more duplication than is done
by cmake.
However, Amitha is working on a dependency engine as we speak to fix this
for vxl.
Do you know of another tool that does these things the "correct way"? If
so, let us know
so we can incorporate the ideas.
-Bill
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake
More information about the CMake
mailing list