[CMake] shared libraries on windows

christian tenllado at dacya.ucm.es
Tue Jul 29 06:27:44 EDT 2008


Hello:

I am starting with cmake in order to have my project running on both
linux and windows.

In my project I create a library and several console tools linked with
this library.

I would like to use shared libraries (.so in linux and .dll in windows)

In my CMakeLists.txt I have for the library target domething like:

ADD_LIBRARY(MYLIB SHARED ${MYLIB_SRC})

The tools are linked like:

TARGET_LINK_LIBRARIES(Tool1 MYLIB)

In Linux and Cygwin this works fine. However in Windows cmake creates
the dll file but tries to link with the .lib file, which does not exist.

Can anybody help me?




More information about the CMake mailing list