[CMake] CMake Visual Studio 2005 and DLLs

Theodore Papadopoulo Theodore.Papadopoulo at sophia.inria.fr
Sat Mar 20 14:30:36 EDT 2010


     Hi,

I have the following problem.
I try to build a DLL library with Visula Studio 2005. The project is 
schematically structured in this way:

project:
      src
      test
      zlib

The src directory contains the sources of the DLL library.
The test directory contains a sample binary that implements testing.
The zlib directory contains zlib sources and tests.

I think I have followed all the rules (dllspec and so on) found in the 
FAQ. Everything compiles and links correctly.
zlib is also compiled as a DLL and tests are working (probably because 
they are in the same directory).
All the tests (in the test directory) that use the DLL in the src 
directory fail at runtime because they do not
find the dll... I suspect this is because of a different directory. All 
the examples I have found use the same directory
for the DLL and the examples.

I suspect this is a fairly common problem with a well known solution, 
but I spent the whole afternoon in googling
various Cmake and microsoft documents without finding a proper solution. 
I hope that the schematics provided
above may be enought to trigger an answer.... but I can provide a zip 
file with the project if necessary.

Another problem that arises with both Visual Studio 2005 and under MacOs 
X, is that when building in an out of source
directory with spaces in its name (a rather stupid idea in my view, but 
that exists...) then I have troubles in detecting
the compilers in the same way that has been reported recently on the list.

By the way this is with cmake 2.8.

If anyone can provide an hint, I'll be very grateful.

     Thank's a lot,

         Theo.



More information about the CMake mailing list