[cmake-developers] how can I set per-config rpath ?

Brad King brad.king at kitware.com
Mon Jun 5 16:35:50 EDT 2017


On 06/05/2017 10:33 AM, comic fans wrote:
> cmake/tests/jump/executable script called link_directories to set rpath,
> how could I set this per-config ?(debug exe use debug library output
> dir as rpath, release exe use release library output dir as rpath).
> this is for experimental fastbuild generator test, which supports running
> in linux and multi-config

I don't think we have a model for per-config rpath currently.  The only
multi-config generator we have on a platform that defines rpath is Xcode
on macOS.

Note that we have two different rpath values: one for the build tree
(e.g. from link_directories or the locations of linked libraries),
and one for the install tree (INSTALL_RPATH).  The places evaluating
each of these should already be per-config, but are only ever evaluated
for one configuration by the Makefile and Ninja generators.

The build tree rpath comes from locations of artifacts and other things
that are already per-config.  For INSTALL_RPATH perhaps generator expression
support would be needed.

-Brad



More information about the cmake-developers mailing list