2020-01-25 14:36:31 +00:00
|
|
|
# Copyright 2019-2020, Collabora, Ltd.
|
2019-03-18 05:52:32 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
2019-04-29 16:18:09 +00:00
|
|
|
|
2019-03-18 05:52:32 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../auxiliary
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-12-03 20:40:55 +00:00
|
|
|
set(ENABLED_HEADSET_DRIVERS)
|
|
|
|
set(ENABLED_DRIVERS)
|
|
|
|
|
2020-01-25 14:36:31 +00:00
|
|
|
if(BUILD_DRIVER_DUMMY)
|
|
|
|
set(DUMMY_SOURCE_FILES
|
|
|
|
dummy/dummy_hmd.c
|
|
|
|
dummy/dummy_interface.h
|
|
|
|
dummy/dummy_prober.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_dummy OBJECT ${DUMMY_SOURCE_FILES})
|
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS dummy)
|
|
|
|
endif()
|
|
|
|
|
2019-04-29 16:18:09 +00:00
|
|
|
if(BUILD_DRIVER_HDK)
|
2019-03-18 05:52:32 +00:00
|
|
|
set(HDK_SOURCE_FILES
|
|
|
|
hdk/hdk_device.cpp
|
|
|
|
hdk/hdk_device.h
|
|
|
|
hdk/hdk_interface.h
|
|
|
|
hdk/hdk_prober.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_hdk OBJECT ${HDK_SOURCE_FILES})
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS hdk)
|
2019-03-18 05:52:32 +00:00
|
|
|
endif()
|
2019-04-29 16:18:09 +00:00
|
|
|
|
|
|
|
|
2019-06-19 21:50:55 +00:00
|
|
|
if(BUILD_DRIVER_HYDRA)
|
|
|
|
set(HYDRA_SOURCE_FILES
|
|
|
|
hydra/hydra_driver.c
|
|
|
|
hydra/hydra_interface.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_hydra OBJECT ${HYDRA_SOURCE_FILES})
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_DRIVERS hydra)
|
2019-06-19 21:50:55 +00:00
|
|
|
endif()
|
|
|
|
|
2020-01-24 21:35:12 +00:00
|
|
|
if(BUILD_DRIVER_NS)
|
|
|
|
set(NS_SOURCE_FILES
|
|
|
|
north_star/ns_hmd.c
|
|
|
|
north_star/ns_interface.h
|
|
|
|
north_star/ns_prober.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_ns OBJECT ${NS_SOURCE_FILES})
|
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS ns)
|
|
|
|
endif()
|
|
|
|
|
2019-04-29 16:18:09 +00:00
|
|
|
if(BUILD_DRIVER_OHMD)
|
|
|
|
set(OHMD_SOURCE_FILES
|
|
|
|
ohmd/oh_device.c
|
|
|
|
ohmd/oh_device.h
|
|
|
|
ohmd/oh_interface.h
|
|
|
|
ohmd/oh_prober.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_ohmd OBJECT ${OHMD_SOURCE_FILES})
|
|
|
|
target_include_directories(drv_ohmd SYSTEM
|
|
|
|
PRIVATE ${OPENHMD_INCLUDE_DIRS}
|
|
|
|
)
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS openhmd)
|
2019-04-29 16:18:09 +00:00
|
|
|
endif()
|
2019-04-20 01:23:50 +00:00
|
|
|
|
|
|
|
|
2019-05-31 16:52:54 +00:00
|
|
|
if(BUILD_DRIVER_PSMV)
|
|
|
|
set(PSMOVE_SOURCE_FILES
|
|
|
|
psmv/psmv_driver.c
|
|
|
|
psmv/psmv_interface.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_psmv OBJECT ${PSMOVE_SOURCE_FILES})
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_DRIVERS psmv)
|
2019-05-31 16:52:54 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2019-04-20 01:23:50 +00:00
|
|
|
if(BUILD_DRIVER_PSVR)
|
|
|
|
set(PSVR_SOURCE_FILES
|
|
|
|
psvr/psvr_device.c
|
|
|
|
psvr/psvr_device.h
|
|
|
|
psvr/psvr_interface.h
|
|
|
|
psvr/psvr_packet.c
|
|
|
|
psvr/psvr_prober.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_psvr OBJECT ${PSVR_SOURCE_FILES})
|
|
|
|
target_include_directories(drv_psvr SYSTEM
|
|
|
|
PRIVATE ${HIDAPI_INCLUDE_DIRS}
|
|
|
|
)
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS psvr)
|
2019-04-20 01:23:50 +00:00
|
|
|
endif()
|
2019-07-22 18:21:04 +00:00
|
|
|
|
2019-10-02 11:00:52 +00:00
|
|
|
if(BUILD_DRIVER_VIVE)
|
|
|
|
set(VIVE_SOURCE_FILES
|
|
|
|
vive/vive_device.h
|
|
|
|
vive/vive_device.c
|
|
|
|
vive/vive_prober.h
|
|
|
|
vive/vive_prober.c
|
|
|
|
vive/vive_protocol.h
|
2019-11-14 17:37:29 +00:00
|
|
|
)
|
2019-10-02 11:00:52 +00:00
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
2019-11-01 21:42:56 +00:00
|
|
|
add_library(drv_vive OBJECT ${VIVE_SOURCE_FILES})
|
2019-10-02 11:00:52 +00:00
|
|
|
target_include_directories(drv_vive SYSTEM PRIVATE ../../external)
|
|
|
|
target_link_libraries(drv_vive z)
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_HEADSET_DRIVERS vive)
|
2019-10-02 11:00:52 +00:00
|
|
|
endif()
|
2019-07-22 18:21:04 +00:00
|
|
|
|
|
|
|
if(BUILD_DRIVER_V4L2)
|
|
|
|
set(V4L2_SOURCE_FILES
|
|
|
|
v4l2/v4l2_driver.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Use OBJECT to not create a archive, since it just gets in the way.
|
|
|
|
add_library(drv_v4l2 OBJECT ${V4L2_SOURCE_FILES})
|
2019-12-03 20:40:55 +00:00
|
|
|
list(APPEND ENABLED_DRIVERS v4l2)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLED_HEADSET_DRIVERS)
|
|
|
|
set(ENABLED_DRIVERS ${ENABLED_HEADSET_DRIVERS} ${ENABLED_DRIVERS})
|
|
|
|
list(SORT ENABLED_DRIVERS)
|
|
|
|
string(REPLACE ";" " " ENABLED_DRIVERS "${ENABLED_DRIVERS}")
|
|
|
|
message(STATUS "Enabled drivers: ${ENABLED_DRIVERS}")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "You must enable at least one headset driver to build Monado.")
|
2019-07-22 18:21:04 +00:00
|
|
|
endif()
|