2020-06-10 13:48:43 +00:00
|
|
|
# Copyright 2020, Collabora, Ltd.
|
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
2020-11-09 23:16:38 +00:00
|
|
|
add_library(driver_monado MODULE main.c)
|
2020-06-10 13:48:43 +00:00
|
|
|
|
2020-11-09 23:16:38 +00:00
|
|
|
target_link_libraries(
|
|
|
|
driver_monado PRIVATE xrt-external-openvr aux_util st_ovrd st_prober target_lists target_instance_no_comp
|
2020-06-10 13:48:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# meta data that the steamvr plugin needs in the base directory of the steamvr plugin
|
2020-11-09 23:16:38 +00:00
|
|
|
file(COPY driver.vrdrivermanifest DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
|
|
|
file(COPY resources DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
2020-06-10 13:48:43 +00:00
|
|
|
|
|
|
|
#determine the output directory for the steamvr plugin
|
2020-11-09 23:16:38 +00:00
|
|
|
if(WIN32)
|
|
|
|
# FIXME need to account for different architectures
|
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/win64
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/win32
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
endif()
|
2020-06-10 13:48:43 +00:00
|
|
|
elseif(APPLE)
|
2020-11-09 23:16:38 +00:00
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx64
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx32
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
endif()
|
2020-06-10 13:48:43 +00:00
|
|
|
elseif(NOT ANDROID)
|
2020-11-09 23:16:38 +00:00
|
|
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux64
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(PLUGINDIR
|
|
|
|
${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux32
|
|
|
|
CACHE INTERNAL ""
|
|
|
|
)
|
|
|
|
endif()
|
2020-06-10 13:48:43 +00:00
|
|
|
endif()
|
|
|
|
|
2020-11-09 23:16:38 +00:00
|
|
|
message("SteamVR plugin path: ${PLUGINDIR}")
|
2020-06-10 13:48:43 +00:00
|
|
|
set_target_properties(driver_monado PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PLUGINDIR}")
|
|
|
|
|
|
|
|
# don't add lib prefix to driver_monado.so
|
2020-11-09 23:16:38 +00:00
|
|
|
set_target_properties(driver_monado PROPERTIES PREFIX "")
|
2020-06-10 13:48:43 +00:00
|
|
|
|
|
|
|
install(DIRECTORY "${PROJECT_BINARY_DIR}/steamvr-monado" DESTINATION "${CMAKE_INSTALL_PREFIX}/share")
|