[CMake] HowTo build one Linux binary set for all platforms?

Brad King brad.king at kitware.com
Wed Apr 19 10:03:19 EDT 2006


Matt England wrote:
> At 4/18/2006 11:56 AM, Brad King wrote:
> 
>> I think it's a Mandrake 10 box.
>>
>> There is a bit of a trick needed for CMake due to support for loaded 
>> commands.  We link statically against everything but libc and libdl.  
>> In order to work with the system libc on every other machine you need 
>> to build with the oldest glibc you can find.  We used to use an old 
>> glibc 2.0 system to build binaries but that old machine died so now we 
>> use a glibc 2.3 system.  A few years ago that may have been a problem 
>> but no one has complained yet about needing glibc 2.3.  For the few 
>> people that have such old systems they can build from source.
> 
> 
> More excellent info, thanks again.
> 
> Like my project, CMake appears to be a C++ based one.  Does one need to 
> add a c++ lib to the above list (along with libc and libdl) to the list 
> of special libs?  Presumably not, but I'm checking just to make sure.

No, the C++ library can be linked statically.  That is why we build GCC 
with the --disable-shared option.  If on the other hand you have several 
executables that share code from big libraries then you might consider 
doing a shared library build which needs a different, somewhat 
complicated approach.

-Brad


More information about the CMake mailing list