Daniel Sands wrote:
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
CMake has no table mapping to these flags automatically, but if you set
them up yourself CMake will not change them. Any link library option
beginning with a "-" is left untouched, so you can do something like
SET(MYLIB my_static_lib)
IF("${CMAKE_SYSTEM}" MATCHES IRIX)
SET(MYLIB -Wl,-all -lmy_static_lib -Wl,-notall)
ENDIF("${CMAKE_SYSTEM}" MATCHES IRIX)
#...
TARGET_LINK_LIBRARIES(my_shared_lib ${MYLIB})
-Brad
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake