<div dir="ltr">Thanks. Ok one step back. What we want is to have the same relative path from binary/executable to linked library in build and install tree (which we assume is the same for us). Looks like by default, e.g. cmake 3.9, puts in an absolute path. The current (c-)makefiles compute the relative part of an executable -> library by using LOCATION and add this to -Wl,-rpath=$ORIGIN/[relative part]. We want to do the same w/o LOCATION (i.e. resolving CMP0026)</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 27, 2018 at 7:29 AM Brad King <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 09/26/2018 10:23 AM, Hendrik Greving wrote:<br>
> Is there any way before 3.13 to achieve what I need? Right now we<br>
> modify LINK_FLAGS based on something that is computed with values<br>
> from LOCATION.<br>
[snip]<br>
> our cmake setup is using LOCATION property for two targets to compute<br>
> a relative path from these two, and adds this to LINK_FLAGS<br>
> (for rpath, but irrelevant in this context).<br>
<br>
To at least see if 3.13 will support your use case, you could<br>
try a nightly binary from here:<br>
<br>
<a href="https://cmake.org/files/dev/?C=M;O=D" rel="noreferrer" target="_blank">https://cmake.org/files/dev/?C=M;O=D</a><br>
<br>
Use `$<TARGET_FILE_DIR:mytarget>/..` to refer to a path relative<br>
to the target file location.<br>
<br>
I've never seen a need to adjust link flags based on the target<br>
location. CMake has several features for RPATH support. What<br>
are you really trying to do?<br>
<br>
-Brad<br>
</blockquote></div>