RPATH handling in the wiki -- bug?

During debugging of this issue in stp’s cmake:

We’ve come back to:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling#always-full-rpath

I don’t understand this part there:

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
...
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
    set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")

What’s the purpose of the whole if given CMAKE_INSTALL_RPATH is set to ${CMAKE_INSTALL_PREFIX}/lib above unconditionally?

I agree that it does look odd at least. I’d have to dig in more to figure out what it’s trying to do to figure it out myself though. It seems like it’s trying to make sure that the destination is in the rpath set, but only if it isn’t already a system location.