[CMake] Newbie creating shared objects on Mac

Gerrick Bivins gbivins at objectreservoir.com
Mon Jul 7 15:39:37 EDT 2008


I realized I left out the fact that I'm using the swig module.
Sorry about that.
Does the SWIG_ADD_MODULE have a SWIG_ADD_LIBRARY equivalent?

Alexander Neundorf wrote:
> On Monday 07 July 2008, Gerrick Bivins wrote:
>> Hello,
>> I¹m trying to dive into Cmake and I¹ve tried creating new targets for an
>> existing project using Cmake. So far everything
>> Works ok but on Mac, my shared object targets are creating *.so files. I¹m
>> not concerned about bundles and frameworks but
>> I expected Cmake to produce *.dylib files. Any suggestions?
> 
> Yes, usually it does.
> Which version of cmake is this ?
> Can you send a small test case ?
> 

add_library(foo MODULE foo.c) will create a .so on the mac.
add_library(foo SHARED foo.c) will create a .dylib

-Bill


On 7/7/08 2:26 PM, "Gerrick Bivins" <gbivins at objectreservoir.com> wrote:

> I'm using 2.6. 
> Here's my CMakeLists.txt that I've been using. This isn't my top level
> Cmakefile.
> Gerrick
> 
> 
> On 7/7/08 2:27 PM, "Alexander Neundorf" <a.neundorf-work at gmx.net> wrote:
> 
>> On Monday 07 July 2008, Gerrick Bivins wrote:
>>> Hello,
>>> I’m trying to dive into Cmake and I’ve tried creating new targets for an
>>> existing project using Cmake. So far everything
>>> Works ok but on Mac, my shared object targets are creating *.so files. I’m
>>> not concerned about bundles and frameworks but
>>> I expected Cmake to produce *.dylib files. Any suggestions?
>> 
>> Yes, usually it does.
>> Which version of cmake is this ?
>> Can you send a small test case ?
>> 
>> Alex



More information about the CMake mailing list