[cmake-developers] Setting INSTALL_RPATH no longer works when I start using a custom toolchain file.

Stanislav Pankevich s.pankevich at gmail.com
Fri Feb 17 16:34:52 EST 2017


I have received an answer on StackOverflow:

> Instead of linking to the existed project, please, create Minimal,
Complete, and Verifiable example <http://stackoverflow.com/help/mcve>. As
far as I understand, toolchain file can be compressed to two lines (setting
CMAKE_SYSTEM_NAME and BUILD_SHARED_LIBS variables). The project could also
be compressed to 10-20 lines, where one needn't to search through 100
lines, whether value for *INSTALL_RPATH* is absolute or relative path.
Setting variable *CMAKE_SYSTEM_NAME* always means *cross-compiling*. Do you
perform "fake" cross-compiling, when your *host* is the same as value for
*CMAKE_SYSTEM_NAME*?

My problem was that I was basing my toolchain file on some example I found
on the internet and it contained:

set(CMAKE_SYSTEM_NAME Darwin)

After I had removed this line everything started working perfectly without
any tweaks on *RPATH* variables as it had worked before I introduced a
custom toolchain file.

Thanks for attention.

Stan

On Fri, Feb 17, 2017 at 12:06 PM, Stanislav Pankevich <s.pankevich at gmail.com
> wrote:

> Hello,
>
> Let me cross-post my StackOverflow question here:
>
> http://stackoverflow.com/questions/42294460/setting-
> install-rpath-no-longer-works-when-i-start-using-a-custom-toolchain-file
>
> I am new to CMake, so maybe I am missing something simple there.
>
> Thanks,
>
> Stanislav
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20170217/1447d170/attachment.html>


More information about the cmake-developers mailing list