[CMake] CMake Visual Studio 2005 and DLLs

J Decker d3ck0r at gmail.com
Sat Mar 20 15:23:00 EDT 2010


On Sat, Mar 20, 2010 at 11:30 AM, Theodore Papadopoulo
<Theodore.Papadopoulo at sophia.inria.fr> wrote:
>    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 thought this was something I had done... my install target that
works for watcom and mingw don't work in visual studio xx either.  If
it would run it from the install directory (if it would get built) it
would be ok too.
Target projects should have Output Directory set to <inherit fro
solution defaults> which in 2010 means $(SolutionDir)$(configuration)/
or something...

> 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.
>
> _______________________________________________
> 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
>


More information about the CMake mailing list