Improve compilation UX;

This commit is contained in:
bjorn 2016-10-24 14:09:32 -07:00
parent 2267396e5a
commit 2b11142970
2 changed files with 10 additions and 5 deletions

View File

@ -76,15 +76,17 @@ if(WIN32)
$<TARGET_FILE_DIR:lovr>
)
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()

View File

@ -1,5 +1,8 @@
#include "vive.h"
#include <stdbool.h>
#ifndef WIN32
#define __stdcall
#endif
#include <openvr_capi.h>
#include <stdlib.h>
#include "../util.h"