Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/openvr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Selan <jeremys@valvesoftware.com>2017-06-13 23:11:41 +0300
committerJeremy Selan <jeremys@valvesoftware.com>2017-06-13 23:11:41 +0300
commitbcac1bfbe2be3c1ff37e4f62b8e412fcdf29248e (patch)
tree476ccae3c40a328d79cff2f5f4b916a0ae783fd7 /src
parentdc860fe405dd93803e55dc662cae590edf6c7cb3 (diff)
OSX sdk changesv1.0.8
- Adds pre-built OpenVR.framework for macOS support, defaults to universal 32-/64-bit binary building, see src/README - corrects macOS framework structure and @rpath of .framework and .dylib binaries. supports building 32-bit-only dylib. CL3996577, 3996634, 4006665 [git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 4009638]
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt28
-rw-r--r--src/Info.plist18
-rw-r--r--src/README12
3 files changed, 51 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5ad5cfa..58954d6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,15 +5,15 @@ set( LIBNAME "openvr_api" )
# Set some properies for specific files.
if(APPLE)
- set(CMAKE_MACOSX_RPATH 0)
+ set(CMAKE_MACOSX_RPATH 1)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set_source_files_properties(vrcommon/pathtools_public.cpp vrcommon/vrpathregistry_public.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++")
endif()
- if(BUILD_SHARED)
+ if(BUILD_SHARED OR BUILD_FRAMEWORK)
find_library(FOUNDATION_FRAMEWORK Foundation)
mark_as_advanced(FOUNDATION_FRAMEWORK)
set(EXTRA_LIBS ${EXTRA_LIBS} ${FOUNDATION_FRAMEWORK})
- endif(BUILD_SHARED)
+ endif(BUILD_SHARED OR BUILD_FRAMEWORK)
elseif(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions( -DWIN64 )
@@ -61,6 +61,28 @@ source_group("VRCommon" FILES
# Build the library.
if(BUILD_SHARED)
add_library(${LIBNAME} SHARED ${SOURCE_FILES})
+elseif(BUILD_FRAMEWORK)
+ set( LIBNAME "OpenVR" )
+ add_library( ${LIBNAME}
+ SHARED ${SOURCE_FILES}
+ ${CMAKE_SOURCE_DIR}/headers/openvr.h
+ ${CMAKE_SOURCE_DIR}/headers/openvr_api.cs
+ ${CMAKE_SOURCE_DIR}/headers/openvr_api.json
+ ${CMAKE_SOURCE_DIR}/headers/openvr_capi.h
+ ${CMAKE_SOURCE_DIR}/headers/openvr_driver.h
+ )
+ set_target_properties(OpenVR PROPERTIES
+ FRAMEWORK TRUE
+ FRAMEWORK_VERSION A
+ MACOSX_FRAMEWORK_IDENTIFIER com.valvesoftware.OpenVR.framework
+ MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/Info.plist
+ # "current version" in semantic format in Mach-O binary file
+ VERSION 1.0.6
+ # "compatibility version" in semantic format in Mach-O binary file
+ SOVERSION 1.0.0
+ PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/headers/openvr.h;${CMAKE_SOURCE_DIR}/headers/openvr_api.cs;${CMAKE_SOURCE_DIR}/headers/openvr_api.json;${CMAKE_SOURCE_DIR}/headers/openvr_capi.h;${CMAKE_SOURCE_DIR}/headers/openvr_driver.h"
+ LINKER_LANGUAGE CXX
+ )
else()
add_library(${LIBNAME} STATIC ${SOURCE_FILES})
endif()
diff --git a/src/Info.plist b/src/Info.plist
new file mode 100644
index 0000000..50ff90a
--- /dev/null
+++ b/src/Info.plist
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleIdentifier</key>
+ <string>com.valvesoftware.OpenVR.framework</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>OpenVR</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+</dict>
+</plist>
diff --git a/src/README b/src/README
index 953e105..826c58d 100644
--- a/src/README
+++ b/src/README
@@ -3,9 +3,9 @@ OpenVR applications to the SteamVR runtime, taking into account the version
of the OpenVR interface they were compiled against.
The client binding library - openvr_api.dll on Windows, openvr_api.so on
-Linux, and openvr_api.dylib on macOS - knows how to find and read the
-SteamVR runtime installation information which allows it to find and
-dynamically connect to the installed runtime. In combination with the
+Linux, and openvr_api.dylib or OpenVR.framework on macOS - knows how to find
+and read the SteamVR runtime installation information which allows it to
+find and dynamically connect to the installed runtime. In combination with the
interface version identifiers from /include/openvr.h which are baked
into applications at the time they are built, the OpenVR API client
binding library captures and conveys to the SteamVR runtime the version
@@ -32,4 +32,8 @@ for your platform. For example, to build on a POSIX system simply perform
cd src; mkdir _build; cd _build; cmake ..; make
-and you will end up with the static library /src/_build/libopenvr_api.a \ No newline at end of file
+and you will end up with the static library /src/bin/<arch>/libopenvr_api.a
+
+To build a shared library, pass -DBUILD_SHARED=1 to cmake.
+To build as a framework on apple platforms, pass -DBUILD_FRAMEWORK=1 to cmake.
+To see a complete list of configurable build options, use `cmake -LAH`