install(TARGETS): Allow RENAME
The RENAME option is currently only allowed/supported for the FILES/PROGRAMS signature.
Using install(FILES ...)
instead of install(TARGETS ...)
skips any special handling like setting RPATH/RUNPATH during installation.
Having this seems to be an expected option: #19903 (comment 646049)
Tried several workarounds:
- Copy (rename) the TARGET lib/executable, use
add_library(renamed IMPORTED SHARED)
and install it withinstall(IMPORTED_RUNTIME_ARTIFACTS)
, but this still skips any RPATH handling - set
RPATH_*
properties on a custom target for the renamed binary, but this has no effect
For adjusting the RPATH, this could be done manually using file(RPATH_CHANGE)
, but this is not official API (see #16825).
Edited by Brad King