From 40d8446ba8ea5377c630d33df991762ae6ff6f30 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Fri, 14 Jun 2019 12:23:30 -0700 Subject: [PATCH] oxr: Use absolute path of runtime library in manifest Improves robustness when there might be multiple libraries by the same name visible to the loader. --- src/xrt/targets/openxr/CMakeLists.txt | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/xrt/targets/openxr/CMakeLists.txt b/src/xrt/targets/openxr/CMakeLists.txt index cc9892f49..e9b77a049 100644 --- a/src/xrt/targets/openxr/CMakeLists.txt +++ b/src/xrt/targets/openxr/CMakeLists.txt @@ -31,21 +31,6 @@ file( } ") -### -# Generate runtime manifest with relative path to runtime intendend for installed release build -# (assumes the runtime library is in the loader's search path) -file( - GENERATE - OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}.json" - CONTENT -"{ - \"file_format_version\": \"1.0.0\", - \"runtime\": { - \"library_path\": \"$\" - } -} -") - include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../targets/common ${CMAKE_CURRENT_SOURCE_DIR}/../../auxiliary @@ -91,6 +76,21 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") include(GNUInstallDirs) + + ### + # Generate runtime manifest with absolute path to installed runtime + file( + GENERATE + OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}.json" + CONTENT +"{ + \"file_format_version\": \"1.0.0\", + \"runtime\": { + \"library_path\": \"${CMAKE_INSTALL_FULL_LIBDIR}/$\" + } +} +") + install(TARGETS ${RUNTIME_TARGET} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}