[CMake] Can't get static executable

Steven Van Ingelgem steven at vaningelgem.be
Fri Jan 11 06:55:40 EST 2008


I'm anxiously waiting on this feature as well.

I have been in communication with Brad King about this and he told me
it's no easy feat. He has to rewrite a lot of the linking algorithm to
allow archive-libraries.

He also told me that it'll be available in CMake 2.6.0, so I'm afraid
we're out of luck there for quite some time.


Greetings



On 11/01/2008, Eneko Nieto <eneko at bluexare.org> wrote:
> Hi,
>
> I wanted to compile Gammu for getting a static executable but I didn't
> achieve. I asked in the Gammu mailing list but the actual maintainer answered
> he didn't know how to configure CMake for compiling statically. More info in
> the original mail.
>
> Could anyone help me?
>
> Thanks in advance
>
> Eneko
>
> On Friday 11 January 2008 10:20:59 Michal Čihař wrote:
> > Hi
> >
> > On Fri, 11 Jan 2008 09:54:40 +0100
> >
> > Eneko Nieto <eneko at bluexare.org> wrote:
> > > Now, my problem. I want to get a static gammu executable for using it in
> > > systems with no libc, bluez and no other dependencies. I tried it with
> > > normal compile (./configure;make) and with CMake (mkdir build;cd
> > > build;cmake ..;ccmake ..) setting CMAKE_EXE_LINKER_FLAGS to -static.
> > >
> > > Sadly my result is always the same:
> > > $ file ./gammu/gammu
> > > ./gammu/gammu: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
> > > for GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
> > >
> > > Could anyone help me?
> >
> > I have no idea how to force CMake to linking external libraries as
> > static as FIND_LIBRARY seems to prefer .so in all cases. Try asking on
> > CMake mailing list.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list