Handle CMAKE_INSTALL_LIBDIR being absolute

This seems to be common in distro packaging environments.
This commit is contained in:
Benjamin Saunders 2019-08-16 14:52:45 +00:00 committed by Ryan Pavlik
parent 261b9125f6
commit dbbfe8e455

View file

@ -12,7 +12,10 @@ string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}")
if(OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH)
# Absolute path to runtime
set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME})
set(RUNTIME_PATH ${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME})
if(NOT IS_ABSOLUTE ${RUNTIME_RELATIVE_DIR})
set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH})
endif()
else()
# Relative path to runtime: requires it exist on the system shared library search path.
set(RUNTIME_PATH ${RUNTIME_FILENAME})