From 2b1114297085410f7c8f50045024514170383dab Mon Sep 17 00:00:00 2001 From: bjorn Date: Mon, 24 Oct 2016 14:09:32 -0700 Subject: [PATCH] Improve compilation UX; --- CMakeLists.txt | 12 +++++++----- src/headset/vive.c | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30551a7d..99ad0140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,15 +76,17 @@ if(WIN32) $ ) else() - if(EXISTS ${OPENVR_DIR}) - include_directories(${OPENVR_DIR}/headers) + if(DEFINED OPENVR_DIR) + get_filename_component(FULL_OPENVR_DIR ${OPENVR_DIR} ABSOLUTE BASE_DIR ${CMAKE_BINARY_DIR}) + message(STATUS "Setting OpenVR root directory to ${FULL_OPENVR_DIR}") + include_directories(${FULL_OPENVR_DIR}/headers) if(APPLE) - set(LOVR_OPENVR ${OPENVR_DIR}/lib/osx32/libopenvr_api.dylib) + set(LOVR_OPENVR ${FULL_OPENVR_DIR}/lib/osx32/libopenvr_api.dylib) else() - set(LOVR_OPENVR ${OPENVR_DIR}/lib/linux32/libopenvr_api.so) + set(LOVR_OPENVR ${FULL_OPENVR_DIR}/lib/linux32/libopenvr_api.so) endif() else() - message(FATAL_ERROR "Please specify the absolute location of OpenVR (-DOPENVR_DIR=/path/to/openvr)") + message(FATAL_ERROR "Please specify the location of OpenVR (-DOPENVR_DIR=/path/to/openvr)") endif() endif() diff --git a/src/headset/vive.c b/src/headset/vive.c index bb790b69..d6d23748 100644 --- a/src/headset/vive.c +++ b/src/headset/vive.c @@ -1,5 +1,8 @@ #include "vive.h" #include +#ifndef WIN32 +#define __stdcall +#endif #include #include #include "../util.h"