[CMake] *.so on Mac

Michael Wild themiwi at gmail.com
Mon Sep 5 00:49:45 EDT 2011


On Sun 04 Sep 2011 11:14:45 PM CEST, Yifei Li wrote:
> Hi all,
>
> Shouldn't dynamic libraries on Mac have "dylib" as their extension? 
>
> Why does MyLib have an extension "so" when I use add_library(MyLib MODULE)?
>
> Thanks
>
> Yifei

Because a MODULE is normally a "plugin" library, and these 
traditionally have the extension .so on Mac. If you create a SHARED 
library, you will get a .dylib. If you don't agree with that choice, 
you can override it with either the SUFFIX target property or by 
setting the CMAKE_SHARED_LIBRARY_SUFFIX or the 
CMAKE_SHARED_MODULE_SUFFIX variable.

HTH

Michael


More information about the CMake mailing list