[CMake] Windows library target names

Olaf van der Spek olafvdspek at gmail.com
Thu Jul 22 17:25:13 EDT 2010


On Thu, Jul 22, 2010 at 11:14 PM, Michael Jackson
<mike.jackson at bluequartz.net> wrote:
>    So here is what really happens with Visual Studio. When you invoke CMake
> you select to build "Shared" libraries and a Win64 application. These are
> the basics. Visual Studio will create a subdirectory for "Debug" and
> "Release" variants for you. So when you build you get a shared library with
> debug symbols placed in the Build/Debug/ directory and the same for Release
> (Build/Release). Now. since these are completely separate directories when
> you execute your program the correct libraries will be found. Great. This

How does the loader find the DLL?

> falls apart if you "install" your project to a location for other projects
> to get to. Then one library will over write the other.
>
>   In a typical CMake workflow one would create another build directory and
> rerun CMake again to generate another Visual Studio solution that would have
> say a 32 bit Static build in it. This is what CMake kind of expects. You can
> abuse this if you want. Take a look at the boost-cmake project.

Why is this abuse?

>   If you want to go even further and decorate your library names like boost
> does then go ahead and write the CMake code (or grab it from the Boost-cmake
> project). CMake only needs to do what the other platforms do which is NOT
> decorate the library names. VS does not do this by default.

If I look in C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\lib I see plenty of libs with a "d" suffix...

>   You _can_ very easily do this if you want. The code is out there in the
> wild in the form of macros that can be invoked from CMake that will set all
> of this up for you. You just have to look for it (or ask the right person...
> )
>
> Does that help?

Not sure.

Olaf


More information about the CMake mailing list