Jean-Pierre,
I am not sure, how you get -Wl,-Bstatic and so on. Here is how I get static
executable:
$ /usr/bin/c++ -O2 -fomit-frame-pointer -fPIC -s -static \
CMakeFiles/DispatcherExe.dir/DispatcherMain.cc.o \
-o DispatcherExe \
-rdynamic ../../Generic/libGeneric.a \
../../CorbaUtil/libCorbaUtil.a -lmico2.3.13 -lmicocoss2.3.13 -lssl -lcrypto
-lpthread -ldl
$ ldd DispatcherExe
not a dynamic executable
Here is how I link it:
ADD_LIBRARY(Generic STATIC ${GENERIC_SRCS})
ADD_LIBRARY(CorbaUtil STATIC ${CORBAUTIL_SRCS})
TARGET_LINK_LIBRARIES(CorbaUtil ${MICO_LIBRARY} ${MICO_COSS_LIBRARY} ssl
crypto pthread dl)
ADD_EXECUTABLE(DispatcherExe ${OPERDISPATCHER_SRCS})
TARGET_LINK_LIBRARIES(DispatcherExe CorbaUtil Generic)
Denis
--- On Wed, 5/6/09, Jean-Pierre Bergamin <[email protected]> wrote:
> From: Jean-Pierre Bergamin <[email protected]>
> Subject: [CMake] Create executable with no dynamic dependency at all
> To: [email protected]
> Date: Wednesday, May 6, 2009, 11:59 PM
> Hello CMake users
>
> So my question is how to avoid any dynamic linking at all.
> I found this bug report
> http://www.vtk.org/Bug/view.php?id=1644 that says
> that this has been implemented - but how?
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake