[CMake] -fPIC flag on object build for static lib targets?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Oct 2 19:08:36 EDT 2006


On 2006-10-02 22:29+0100 James Mansion wrote:

>>
> http://www.cmake.org/Wiki/CMake_FAQ#Does_CMake_support_.22convenience.22_lib
> raries.3F
>
> The FAQ is misleading - they DO make sense for (all) non-UNIX linkers.  What
> non-UNIX linkers do not have an equivalence to an archive?
>
> There is no reason why I cannot compile a load of objects with DLL
> compilation objects and stick them in a static library for inclusion into
> DLLs later.  I've done it plenty of times in Visual Studio.

Note, I have strong opinions on this subject so I will start with a
disclaimer. My perspective is somebody who is fairly new to CMake,
Unix-only, relatively experienced with autotools, and familiar with using a
convenience library to help build PLplot on Unix with autotools.  That said,
I don't miss convenience libraries at all! As far as I am concerned,
convenience libraries are just one more layer of potential linking
confusion.  The simple and straightforward alternative of having a list of
source files that includes what used to go into the convenience library is
absolutely fine with me. I do realize I have a limited perspective, see
above disclaimer, but just because convenience libraries are possible on
windows platforms (which appears to be the case from your remarks) as well
as the Unix platforms that I am familiar with is not enough justification
for implementing convenience libraries in CMake. Instead, it should ideally
be a carefully weighed CMake developer decision taking all user perspectives
(including mine and yours) and developer perspectives (e.g., on the issues
of ease of implementation and maintenance) into account.

That said, if the FAQ is misleading about the reasons why there are no
"convenience" libraries in CMake, then it should be corrected for the real
reasons behind the (good, from my perspective) decision.  Also, if this thread
ends up with the CMake developers implementing convenience libraries, that
is fine with me, but I won't be using them for PLplot for the reasons stated.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list