Incorrect LINK_LIBRARIES queried when using CMP0079
When trying to dump value of LINK_LIBRARIES
via file(GENERATE)
for my project, I noticed very weird output. I narrowed it down to a minimal example. It seems the problem appears when any link libraries are added in a different directory than add_library
call. This is regulated with CMP0079.
When I add a dependency named SubLib
to my library, the output is as below. The hex value, probably an address, will be different each run.
::@(000001F6B709E8D0);SubLib;::@
When target_link_libraries
call is moved to root CMakeLists.txt
, the output is as expected.
SubLib
Minimal reproducible example is provided here: https://github.com/PlaygroundMD/CmakeGenexBug
Edited by Maciej Dziuban