[CMake] Creating static executables

Ajay Divekar ajay.divekar at guardiantechintl.com
Fri Jun 8 14:37:06 EDT 2007


I am trying to create a static executable and for that I have already defined 
using ADD_Definitions the -static option.

But after it is build and when I do
ldd bbb (where bbb is the executable that was just generated)
	
	The output of the above command is

libz.so.3 => /lib/libz.so.3 (0x281df000)
libstdc++.so.6=> /usr/local/lib/gcc/i386-portbld-freebsd6.2/3.4.6/libstdc++.so.6         
libm.so.4 => /lib/libm.so.4 (0x282b1000)
libc.so.6 => /lib/libc.so.6 (0x282c7000)
libgcc_s.so.1=> /usr/local/lib/gcc/i386-portbld-freebsd6.2/3.4.6/libgcc_s.so.1        
libz.so.2 => /lib/libz.so.2 (0x2814f000)
libm.so.3 => /lib/libm.so.3 (0x2815f000)
libc.so.5 => /lib/libc.so.5 (0x2817a000)

I want my executable to be static as this will make it completely platform 
independent.

All these are system libraries and some of them are gcc releated. Is there 
anyway to create a static library library without any shared library 
dependency.

Regards,
-- 
Ajay Divekar
System Developer
Guardian Technologies International
Tel No : 703-481-4882


More information about the CMake mailing list