[cmake-developers] MSVC LinkLibraryDependencies settable flag

Rosen Diankov rosen.diankov at gmail.com
Tue Apr 12 10:29:12 EDT 2011


are you saying that target_link_libraries will add
LinkLibraryDependencies? Or that LinkLibraryDependencies is not
necessary?

when i was debugging this, i tried everything possible combination of
target_link_libraries, add_dependencies, and static/DLL linking. doing
such an ugly hack was the only way that things worked.

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. Somehow the libopenrave-core DLL
failed to load because of missing symbols, the only way was to enable
LinkLibraryDependencies.

rosen,

2011/4/12 Brad King <brad.king at kitware.com>:
> On 04/11/2011 09:29 PM, Rosen Diankov wrote:
>> When creating a complex project with DLLs depending on static
>> libraries in MSVC, it is necessary to set the
>> LinkLibraryDependencies="true" in the project file, or otherwise
>> things won't work correctly.
>
> That shouldn't be necessary.  In src/libopenrave-core/CMakeLists.txt
> replace
>
>  add_dependencies(libopenrave-core_static ${COLLADA_LIBRARIES})
>
> with
>
>  target_link_libraries(libopenrave-core_static ${COLLADA_LIBRARIES})
>
> CMake will propagate that information to anything that links to the
> target.
>
> -Brad
>



More information about the cmake-developers mailing list