mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-06 01:03:19 +02:00
📦 Added OVR Conan package
This commit is contained in:
parent
edb79980f8
commit
3b7c00648e
4 changed files with 115 additions and 0 deletions
16
conan-recipes/ovr-platform-skd/CMakeLists.txt
Normal file
16
conan-recipes/ovr-platform-skd/CMakeLists.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(LibOVR)
|
||||
|
||||
message(STATUS "Building LibOVR for ${CMAKE_BUILD_TYPE} configuration")
|
||||
|
||||
include_directories(LibOVR/Include LibOVR/Src)
|
||||
file(GLOB HEADER_FILES LibOVR/Include/*.h)
|
||||
file(GLOB EXTRA_HEADER_FILES LibOVR/Include/Extras/*.h)
|
||||
file(GLOB_RECURSE SOURCE_FILES LibOVR/Shim/*.c LibOVR/Shim/*.cpp)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOVR_BUILD_DEBUG")
|
||||
add_library(LibOVR STATIC ${SOURCE_FILES} ${HEADER_FILES} ${EXTRA_HEADER_FILES})
|
||||
set_target_properties(LibOVR PROPERTIES DEBUG_POSTFIX "d")
|
||||
|
||||
install(TARGETS LibOVR DESTINATION lib)
|
||||
install(FILES ${HEADER_FILES} DESTINATION include)
|
||||
install(FILES ${EXTRA_HEADER_FILES} DESTINATION include/extras)
|
37
conan-recipes/ovr-platform-skd/conanfile.py
Normal file
37
conan-recipes/ovr-platform-skd/conanfile.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
from conan import ConanFile
|
||||
from conan.tools.files import get, copy, collect_libs
|
||||
import os
|
||||
|
||||
|
||||
class OVRPlatformConan(ConanFile):
|
||||
name = "ovr-platform-skd"
|
||||
version = "1.10.0"
|
||||
author = "Edgar (Edgar@AnotherFoxGuy.com)"
|
||||
settings = "os", "arch"
|
||||
|
||||
def build(self):
|
||||
get(
|
||||
self,
|
||||
url="https://build-deps.overte.org/dependencies/OVRPlatformSDK_v1.10.0.zip",
|
||||
sha256="4d0ecc491e4ddfc88056b674deef5a0a9a023d2f03b89e5ec6c1415863d200b2",
|
||||
)
|
||||
|
||||
def package(self):
|
||||
copy(
|
||||
self,
|
||||
"*.h",
|
||||
os.path.join(self.source_folder, "Include"),
|
||||
os.path.join(self.package_folder, "include"),
|
||||
)
|
||||
copy(
|
||||
self,
|
||||
"LibOVRPlatform64_1.lib",
|
||||
os.path.join(self.source_folder, "Windows"),
|
||||
os.path.join(self.package_folder, "lib"),
|
||||
keep_path=False,
|
||||
)
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.set_property("cmake_file_name", "OVRPlatform")
|
||||
self.cpp_info.set_property("cmake_target_name", "OVR::Platform")
|
||||
self.cpp_info.libs = collect_libs(self)
|
16
conan-recipes/ovr-skd/CMakeLists.txt
Normal file
16
conan-recipes/ovr-skd/CMakeLists.txt
Normal file
|
@ -0,0 +1,16 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(LibOVR)
|
||||
|
||||
message(STATUS "Building LibOVR for ${CMAKE_BUILD_TYPE} configuration")
|
||||
|
||||
include_directories(LibOVR/Include LibOVR/Src)
|
||||
file(GLOB HEADER_FILES LibOVR/Include/*.h)
|
||||
file(GLOB EXTRA_HEADER_FILES LibOVR/Include/Extras/*.h)
|
||||
file(GLOB_RECURSE SOURCE_FILES LibOVR/Shim/*.c LibOVR/Shim/*.cpp)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DOVR_BUILD_DEBUG")
|
||||
add_library(LibOVR STATIC ${SOURCE_FILES} ${HEADER_FILES} ${EXTRA_HEADER_FILES})
|
||||
set_target_properties(LibOVR PROPERTIES DEBUG_POSTFIX "d")
|
||||
|
||||
install(TARGETS LibOVR DESTINATION lib)
|
||||
install(FILES ${HEADER_FILES} DESTINATION include)
|
||||
install(FILES ${EXTRA_HEADER_FILES} DESTINATION include/extras)
|
46
conan-recipes/ovr-skd/conanfile.py
Normal file
46
conan-recipes/ovr-skd/conanfile.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
from conan import ConanFile
|
||||
from conan.tools.files import get, copy, collect_libs
|
||||
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps
|
||||
import os
|
||||
|
||||
|
||||
class OVRConan(ConanFile):
|
||||
name = "ovr-skd"
|
||||
version = "1.35.0"
|
||||
author = "Edgar (Edgar@AnotherFoxGuy.com)"
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
exports_sources = "CMakeLists.txt"
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.generate()
|
||||
deps = CMakeDeps(self)
|
||||
deps.generate()
|
||||
|
||||
def build(self):
|
||||
strip_root = False
|
||||
if self.settings.os == "Windows":
|
||||
url = "https://build-deps.overte.org/dependencies/ovr_sdk_win_1.35.0.zip"
|
||||
sha256 = "2805619518a0a083f3eca0358ab7f4114d7d94b4abb2b65ced7e95f287df28a2"
|
||||
elif self.settings.os == "Macos":
|
||||
url = "https://build-deps.overte.org/dependencies/ovr_sdk_macos_0.5.0.1.tar.gz"
|
||||
sha256 = "58636983f970467afd18594899c22e70aae923023cd282b913c7c76ae46a8a12"
|
||||
else:
|
||||
url = "https://github.com/jherico/OculusSDK/archive/0d6f0cf110ea7566fc6d64b8d4fe6bb881d9cff5.zip"
|
||||
sha256 = "971e9f6ac8469913bd20445ba03a79e6654eaf71701823aa9fb5cec7c8e51ea6"
|
||||
strip_root = True
|
||||
get(self, url=url, sha256=sha256, strip_root=strip_root)
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.set_property("cmake_file_name", "OVR")
|
||||
self.cpp_info.set_property("cmake_target_name", "OVR::SDK")
|
||||
self.cpp_info.libs = collect_libs(self)
|
||||
if self.settings.os in ["Linux", "FreeBSD"]:
|
||||
self.cpp_info.system_libs.append("rt", "udev")
|
Loading…
Reference in a new issue