[Cmake] for compiling DLLs I need some .libs

Adolfo González Uzábal fito at unizar.es
Mon, 16 Feb 2004 19:07:11 +0100


Hi all.

I'm using CMake 1.6 for compiling a project with MSVC++ 6.0, linking with ITK, 
with Win32 Debug configuration.

I can compile STATIC libraries and call them from my own applications. 

Now I'm trying to compile SHARED libraries. 

I've changed the CMakeLists according to this, so instructions like:

    ADD_LIBRARY(myLibrary STATIC ${SOURCE_FILES})
    ADD_LIBRARY(myOtherLibrary STATIC ${SOURCE_FILES})

have become:

    ADD_LIBRARY(myLibrary SHARED ${SOURCE_FILES})
    ADD_LIBRARY(myOtherLibrary SHARED ${SOURCE_FILES})

But now, I've got some troubles:

.- First I got "unresolved external" errors because of "myOtherLibrary" needs 
functions defined in "myLibrary".

.- Then I've included a line like:

    TARGET_LINK_LIBRARIES (myOtherLibrary myLibrary)

inside the related CMakeLists.txt but then I get:

    LINK : fatal error LNK1104: cannot open file "miLibrary.lib"

which is truly correct since I've built myLibrary.dll but not myLibrary.lib.

Have I missed something?

Best wishes
Adolfo G.U.