[CMake] liblib

William A. Hoffman billlist at nycap.rr.com
Thu Feb 16 14:32:34 EST 2006


At 02:23 PM 2/16/2006, Brandon J. Van Every wrote:

>I have wondered if a global way to control this behavior for all libraries is a good idea.  I mean, most people don't really want to type stuff in for every single library they're building.  Of course you don't want a global behavior to be inescapable; people still have to be able to make local exceptions.

This issue usually comes up when moving a UNIX tool to windows.  
On UNIX all libraries are prefixed with lib, as this is required for
-l to find the library and things to work.  However, on windows,
no such prefix is required, and instead a suffix of .lib is used.
CMake keeps this hidden from the user, as they create a library with
a name, and it may or may not have lib added to the name depending on
the platform, but cmake will be able to use the library.   The problem
comes up when someone wants lib to be a prefix on windows.   For this case
you have to tell cmake to do something different or not the default.  In the
case of chicken it is because chicken dynamically loads a library called
libchicken, and that is hard coded, and does not change based on the platform.

So, I am not sure why you would want to add the prefix lib to all libraries
in a project....

-Bill



More information about the CMake mailing list