[cmake-developers] MSVC LinkLibraryDependencies settable flag

Rosen Diankov rosen.diankov at gmail.com
Tue Apr 12 22:51:00 EDT 2011


I replaced all add_dependency calls with target_link_libraries and
initial results show that things are working! it makes me very happy
to be able to remove this hack ;0)

thanks,
rosen,

2011/4/13 Brad King <brad.king at kitware.com>:
> On 04/12/2011 10:29 AM, Rosen Diankov wrote:
>> are you saying that target_link_libraries will add
>> LinkLibraryDependencies? Or that LinkLibraryDependencies is not
>> necessary?
>
> The latter.  In fact we purposely set LinkLibraryDependencies to false
> so that add_dependencies does NOT cause linking.
>
>> the problem is that a static library compiled in cmake (for example
>> the 3rdparty/collada library)  was getting linked into a cmake DLL
>> (libopenrave-core). However, the collada library was linking with the
>> boost DLLs and some other ones.
>
> add_library(collada ...)
> target_link_libraries(collada ${Boost_LIBS})
> add_library(openrave-core ...)
> target_link_libraries(openrave-core collada) # gets boost transitively
>
> -Brad
>



More information about the cmake-developers mailing list