Axel Roebel wrote:
Hello,
On Wednesday 27 September 2006 07:49, [EMAIL PROTECTED] wrote:
I don't think it matters whether the static library is linked with an
executable or a shared library. Certainly linking to an external shared
library has worked for me recently without me having to do anything
special. Thus, I am virtually positive that linking with a shared library
built by cmake should also work without you doing anything special.
Sorry Alan you are wrong here!
most of the Linux OS don't require the use of -fPIC for shared libraries
some do (notably x86_64 (amd)). In your case where it worked
to link a static library compiled without special means to a shared library
you most likely did that on a system which does not require the -fPIC
flag. On x86_64 this will NOT work and cmake does not take care of it
(I know because it failed for me).
I've built on a bunch of x86_64 machines, and this only cropped up on
one so far--although there are a lot of other variables at play like
the distro version, the compiler version (and 32 vs. 64 bit compile) as
well as the source code changing over time too. Probably not going to
pull a simple example out of this mess...
I couldn't get SET_TARGET_PROPERTIES to add the flag to the compile
line, but I was able to add the flag using SET_SOURCE_FILES_PROPERTIES.
Thanks-
Abe
|
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake