[CMake] LOCATION target property, generator expressions

Brad King brad.king at kitware.com
Tue Oct 2 13:16:46 EDT 2018


On 10/02/2018 01:12 PM, Hendrik Greving wrote:
> By the way, the new generator expression support in 3.13, is this for
> LINK_FLAGS or LINK_OPTIONS.

LINK_OPTIONS, though it should be used through target_link_options.

> And regardless of the former, will it be possible to compute a relative
> path based on generator expressions, i.e.
> file(RELATIVE $<TARGET_FILE_DIR:mytarget> $<TARGET_FILE_DIR:mytargetlib>)?

No, that level of logic is not possible with generator expressions.

I really don't think you should need to do that though.  CMake handles
RPATH in the build tree automatically.  In the install tree you can set
INSTALL_RPATH to whatever relative layout of files you use in your
install rules, which you also control.  If that is not sufficient then
please explain your use case in more detail.  I've never seen this
requirement before.

-Brad


More information about the CMake mailing list