diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index dbcf775d4..d4dee280a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2208,7 +2208,12 @@ bool cmSystemTools::ChangeRPath(std::string const& file, std::string rpathSuffix; { cmELF elf(file.c_str()); - if(cmELF::StringEntry const* se = elf.GetRPath()) + cmELF::StringEntry const* se = elf.GetRPath(); + if(!se) + { + se = elf.GetRunPath(); + } + if(se) { // Make sure the current rpath begins with the old rpath. if(se->Value.length() < oldRPath.length() ||