[CMake] Linking static libraries into shared libs?

Daniel Sands dnsands at sandia.gov
Fri Jun 16 15:34:04 EDT 2006


I have some static libraries and need to link them into my CMAKE 
project's shared libraries.  Is there a platform-independent way to 
specify this?  What I want can be expressed by the following:

g++ -shared -o libmylib.so my_obj_files.o -Wl,-whole-archive 
-lmy_static_lib -Wl,-no-whole-archive

On SGI:
cc -shared -o libmylib.so my_obj_files.o -Wl,-all -lmy_static_lib 
-Wl,-notall

And so on



More information about the CMake mailing list