[CMake] CMake CVS gratuitous /bin directory

Brad King brad.king at kitware.com
Thu Feb 16 19:47:00 EST 2006


Brandon J. Van Every wrote:
> I note that on Cygwin and MinGW, there is no .lib component by default.
> They just link to .dlls directly (and interop with MSVC generated dlls
> isn't straightforward).  So for those compiler targets, if I have a
> target "whatever", and I say I want INSTALL_TARGETS(/ whatever), it
> should put whatever.dll where I said.  There is no other file to consider.

We will be adding support to optionally use a -Wl,--out-implib option to 
produce a .dll.a import library corresponding to the .dll on Cygwin and 
MinGW/MSYS.  Enabling this option will make the behavior closer to that 
of other Windows compilers.

> For MSVC, where one has both whatever.dll and whatever.lib, I think the
> pair should not be broken up unless I explicitly specify
> RUNTIME_DIRECTORY.  i.e. INSTALL_TARGETS(/ whatever ...) should put them
> both in /.

A .dll produced by a SHARED library is an executable, and the .lib is a 
library.  Most windows tools put all the executables (.exe and .dll) in 
one directory and the import library (.lib) in another.  This is why the 
default was chosen the way it is.

However, I agree with your argument about the default behavior, 
especially because the documentation does not mention the /bin default. 
  It will be tricky to fix this without breaking compatibility but I'll 
look at it.  In the worst case we leave it alone, fix the docs, and be 
sure to do it right when the new INSTALL command is expanded to install 
targets (at which point the INSTALL_TARGETS command will be kept for 
compatibility but discouraged from use in new projects).

> Also I am noticing an error that looks like a MSVC bias.  I changed my 
> code to:
[snip]
> which is the normal way that MinGW works.  No stub .lib files.  But the 
> install appears to be looking for .lib files:

This is a bug which I'll look into fixing.

-Brad


More information about the CMake mailing list