[CMake] Can't get static executable

Eneko Nieto eneko at bluexare.org
Fri Jan 11 11:38:35 EST 2008


Thanks Steven and Bill for the multiple answers.

I'm afraid I have not explained my situation properly. I needed to compile 
gammu (which uses CMake to build) as a static executable and after an 
unsuccessful search I asked in the gammu mailing list. The actual maintainer 
said me he didn't know how to do that and recommended me to ask here.

Sadly I'm not familiar with CMake, so I hoped for an easy answer like "just 
put 'cmake -static' and voilà!". It appears that there is not any easy answer 
(until 2.6, isn't so?) so I must learn how to use CMake, reread your answers 
and study how gammu building is done.

Thank you again for the help!

Eneko

On Friday 11 January 2008 15:14:26 Bill Hoffman wrote:
> Steven Van Ingelgem wrote:
> > Sorry Eneko,
> >
> >
> > I should have been more clear.
> > It works nicely in CVS under Linux because the "-L<dir> -Wl,-Bstatic
> > -l<lib>"flags get set correctly. Under a Mac this doesn't work because
> > they use v401 of GCC, which seems to not understand those flags.
> >
> > The change which is needed should be to allow the full path to an
> > archive, and not re-interpret it (for example use
> > "/lib/libwxbase29u.a" instead of changing it to "-L/lib -Wl,-Bstatic
> > -lwxbase29u")
> >
> > What has been discussed can be not better described than what Brad
> > told in the bug report:
> > http://public.kitware.com/Bug/view.php?id=3832
> >
> > Hopes this helps you in your efforts.
>
> OK, so, the work around you can do for now, is to put all your static
> libraries in one directory with sym links and put that directory first.
>   A bit ugly, but if you need to ship a release, it should work.  So,
> that is the manual work around.
>
> Changing to full path links will be a major change, and will likely
> destabilize CVS CMake for a few weeks.   We will do it, but it is not an
> "Easy" fix.
>
> So, on Linux you it should be not to hard to create a static build.  OS
> X does have an issue now.
>
> -Bill
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list