Marcel Loose wrote:
Ping!

I sent this mail more than a week ago, but got no answers.
------------------------------------------------------------------------

Hi all,

I've been searching the documentation, but couldn't find a way to
specify that I want to create a statically linked binary. The only
platform-specific and even compiler-specific answer I could find was to
add "-static" to CMAKE_EXE_LINKER_FLAGS.

Now this solves only part of the problem. Suppose I want to link against
the static library of some 3rd party package Foo. Suppose that Foo only
supplies a libfoo.so (but I'm unaware of this fact).

When I search for the foo-library using find_library(foo_library foo) I
find a match, so CMake happily trods on. But when I type 'make', I'll
discover to my dismay that the system cannot create a  statically linked
executable, because it cannot find libfoo.a. Bummer!

So my question is twofold:

1) Is there a generic platform- and compiler-independent way to specify
that you want to create a statically linked executable?

No.
2) How can I persuade find_library() to only search for static
libraries?

You can't.

-Bill

--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
_______________________________________________
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

Reply via email to