[CMake] strange behaviour of TARGET_LINK_LIBRARIES debug/optimized on MacOS

Clemens Arth Clemens.Arth at gmx.at
Wed Dec 10 08:11:37 EST 2008


Hi, 

-------- Original-Nachricht --------
> Datum: Wed, 10 Dec 2008 13:45:05 +0100
> Von: Hendrik Sattler <post at hendrik-sattler.de>
> An: cmake at cmake.org
> Betreff: Re: [CMake] strange behaviour of TARGET_LINK_LIBRARIES	debug/optimized on MacOS

> Am Wednesday 10 December 2008 13:23:04 schrieb Clemens Arth:
> > Clemens Arth wrote:
> > > before I submit a bug report I wanted to ask you about some strange
> > > behaviour of TARGET_LINK_LIBRARIES on MacOS 10.5 and CMake 2.6-2;
> > >
> > > A library is created for debug and release, named libFooD.dylib and
> > > libFoo.dylib respectively. This works well. Then I create another
> > > library in the following way:
> > >
> > > link_directories(${FooDir}/build/OSX)
> > > add_library(Bar ${BarSources})
> > > set_target_properties(Bar PROPERTIES
> > >  DEBUG_OUTPUT_NAME BarD
> > >  RELEASE_OUTPUT_NAME Bar
> > > )
> 
> You make your life hard, see property DEBUG_POSTFIX
> 

well, that DEBUG_POSTFIX will make surely make things more readable....

> > > It is necessary to link foo to bar, which I thought should with either
> > > of the following ways:
> > >
> > > TARGET_LINK_LIBRARIES(Bar Foo)
> > >
> > > As expected, this only works for Release and not for Debug due to the
> > > appended "D" for the debug library. Changing Foo to FooD works only
> > > for debug, not for release.
> > > However that's the expected behaviour, but then I've tried the
> following:
> > >
> > > TARGET_LINK_LIBRARIES(Bar debug FooD optimized Foo)
> 
> Is Foo created using add_library()?

yes it is built as a shared lib but in another project, so I have to include the output location in LINK_DIRECTORIES... 

Clemens

> 
> HS
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


More information about the CMake mailing list