cmake: allow overriding the rpath setting
Fixes: #18001 (closed)
It seems there was an option for this, but its logic was incorrect.
Cc: @robertmaynard (a4c65dfb) @utkarsh.ayachit @brad.king @brennonbrimhall
Backport: release
Edited by Ben Boeckel