cmake: Run cmake-format.sh

This commit is contained in:
Moses Turner 2022-09-19 13:50:32 -05:00 committed by Jakob Bornecrantz
parent 196bf24276
commit d2e2c3a988
18 changed files with 106 additions and 141 deletions

View file

@ -133,4 +133,6 @@ endif()
# tinyceres
add_library(xrt-external-tinyceres INTERFACE)
target_include_directories(xrt-external-tinyceres SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tinyceres/include)
target_include_directories(
xrt-external-tinyceres SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tinyceres/include
)

View file

@ -1,7 +1,6 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# Common includes
add_library(aux-includes INTERFACE)
target_include_directories(
@ -40,7 +39,10 @@ add_subdirectory(tracking)
add_subdirectory(util)
# Vive helper library.
if(XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE OR XRT_BUILD_DRIVER_REMOTE)
if(XRT_BUILD_DRIVER_VIVE
OR XRT_BUILD_DRIVER_SURVIVE
OR XRT_BUILD_DRIVER_REMOTE
)
add_subdirectory(vive)
endif()

View file

@ -1,14 +1,11 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
android_app_glue STATIC
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
)
target_include_directories(
android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue
)
target_include_directories(android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue)
# disable these warnings in external code
target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic)

View file

@ -1,7 +1,6 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
aux_gstreamer STATIC
gst_internal.h

View file

@ -1,7 +1,6 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
aux_math STATIC
m_api.h

View file

@ -1,7 +1,6 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
aux_os STATIC
os_ble.h

View file

@ -1,7 +1,6 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
aux_tracking STATIC
t_data_utils.c

View file

@ -1,13 +1,7 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(aux_vive STATIC
vive_config.h
vive_config.c
vive_bindings.c
vive_bindings.h
)
add_library(aux_vive STATIC vive_config.h vive_config.c vive_bindings.c vive_bindings.h)
target_link_libraries(
aux_vive
PRIVATE

View file

@ -118,29 +118,27 @@ endif()
if(XRT_HAVE_VULKAN)
set(SHADERS
shaders/clear.comp
shaders/distortion.comp
shaders/mesh.frag
shaders/mesh.vert
shaders/layer.frag
shaders/layer.vert
shaders/equirect1.vert
shaders/equirect1.frag
shaders/equirect2.vert
shaders/equirect2.frag
shaders/clear.comp
shaders/distortion.comp
shaders/mesh.frag
shaders/mesh.vert
shaders/layer.frag
shaders/layer.vert
shaders/equirect1.vert
shaders/equirect1.frag
shaders/equirect2.vert
shaders/equirect2.frag
)
if(XRT_FEATURE_OPENXR_LAYER_CUBE)
list(APPEND SHADERS
shaders/cube.vert
shaders/cube.frag
)
list(APPEND SHADERS shaders/cube.vert shaders/cube.frag)
endif()
spirv_shaders(
SHADER_HEADERS
SPIRV_VERSION
1.0 # Currently targeting Vulkan 1.0
SOURCES ${SHADERS}
SOURCES
${SHADERS}
)
add_library(

View file

@ -2,5 +2,14 @@
# SPDX-License-Identifier: BSL-1.0
add_library(comp_null STATIC null_compositor.c null_compositor.h)
target_link_libraries(comp_null PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk comp_util comp_multi)
target_link_libraries(
comp_null
PUBLIC xrt-interfaces
PRIVATE
aux_util
aux_os
aux_vk
comp_util
comp_multi
)
target_include_directories(comp_null PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)

View file

@ -27,7 +27,10 @@ if(XRT_BUILD_DRIVER_DAYDREAM)
endif()
if(XRT_BUILD_DRIVER_DEPTHAI)
add_library(drv_depthai STATIC depthai/depthai_driver.cpp depthai/depthai_tracked_device.c depthai/depthai_interface.h)
add_library(
drv_depthai STATIC depthai/depthai_driver.cpp depthai/depthai_tracked_device.c
depthai/depthai_interface.h
)
target_link_libraries(
drv_depthai
PRIVATE
@ -43,7 +46,10 @@ if(XRT_BUILD_DRIVER_DEPTHAI)
endif()
if(XRT_BUILD_DRIVER_SIMULATED)
add_library(drv_simulated STATIC simulated/simulated_hmd.c simulated/simulated_interface.h simulated/simulated_prober.c)
add_library(
drv_simulated STATIC simulated/simulated_hmd.c simulated/simulated_interface.h
simulated/simulated_prober.c
)
target_link_libraries(drv_simulated PRIVATE xrt-interfaces aux_util)
list(APPEND ENABLED_HEADSET_DRIVERS simulated)
endif()
@ -115,15 +121,25 @@ endif()
if(XRT_BUILD_DRIVER_OPENGLOVES)
add_library(
drv_opengloves STATIC
opengloves/opengloves_interface.h opengloves/opengloves_device.c opengloves/opengloves_prober.c opengloves/opengloves_device.h opengloves/communication/serial/opengloves_serial.h opengloves/communication/serial/opengloves_serial.c opengloves/encoding/alpha_encoding.h opengloves/encoding/alpha_encoding.cpp opengloves/encoding/encoding.h opengloves/communication/bluetooth/opengloves_bt_serial.h opengloves/communication/bluetooth/opengloves_bt_serial.c opengloves/communication/opengloves_communication.h opengloves/communication/serial/opengloves_prober_serial.h opengloves/communication/serial/opengloves_prober_serial.c opengloves/communication/bluetooth/opengloves_prober_bt.h opengloves/communication/bluetooth/opengloves_prober_bt.c)
target_link_libraries(drv_opengloves
PRIVATE
xrt-interfaces
aux_util
aux_os
bluetooth
)
drv_opengloves STATIC
opengloves/opengloves_interface.h
opengloves/opengloves_device.c
opengloves/opengloves_prober.c
opengloves/opengloves_device.h
opengloves/communication/serial/opengloves_serial.h
opengloves/communication/serial/opengloves_serial.c
opengloves/encoding/alpha_encoding.h
opengloves/encoding/alpha_encoding.cpp
opengloves/encoding/encoding.h
opengloves/communication/bluetooth/opengloves_bt_serial.h
opengloves/communication/bluetooth/opengloves_bt_serial.c
opengloves/communication/opengloves_communication.h
opengloves/communication/serial/opengloves_prober_serial.h
opengloves/communication/serial/opengloves_prober_serial.c
opengloves/communication/bluetooth/opengloves_prober_bt.h
opengloves/communication/bluetooth/opengloves_prober_bt.c
)
target_link_libraries(drv_opengloves PRIVATE xrt-interfaces aux_util aux_os bluetooth)
list(APPEND ENABLED_DRIVERS opengloves)
endif()
@ -256,10 +272,7 @@ if(XRT_BUILD_DRIVER_HANDTRACKING)
endif()
if(XRT_BUILD_DRIVER_SURVIVE)
add_library(
drv_survive STATIC survive/survive_driver.c
survive/survive_interface.h
)
add_library(drv_survive STATIC survive/survive_driver.c survive/survive_interface.h)
target_link_libraries(
drv_survive
PRIVATE
@ -374,16 +387,11 @@ if(XRT_BUILD_DRIVER_EUROC)
endif()
if(XRT_BUILD_DRIVER_SIMULAVR)
add_library(
drv_svr STATIC
simula/svr_hmd.c
simula/svr_interface.h
)
add_library(drv_svr STATIC simula/svr_hmd.c simula/svr_interface.h)
target_link_libraries(drv_svr PRIVATE xrt-interfaces aux_math xrt-external-cjson)
list(APPEND ENABLED_HEADSET_DRIVERS svr)
endif()
if(XRT_BUILD_SAMPLES)
# We build the sample driver to make sure it stays valid,
# but it never gets linked into a final target.

View file

@ -33,6 +33,9 @@ if(XRT_FEATURE_STEAMVR_PLUGIN)
add_subdirectory(steamvr_drv)
endif()
if(XRT_FEATURE_SERVICE AND XRT_HAVE_SDL2 AND XRT_HAVE_VULKAN)
if(XRT_FEATURE_SERVICE
AND XRT_HAVE_SDL2
AND XRT_HAVE_VULKAN
)
add_subdirectory(sdl_test)
endif()

View file

@ -5,11 +5,9 @@
# Lists
#
add_library(target_lists STATIC
target_builder_interface.h
target_builder_legacy.c
target_lists.c
target_lists.h
add_library(
target_lists STATIC target_builder_interface.h target_builder_legacy.c target_lists.c
target_lists.h
)
target_link_libraries(
target_lists

View file

@ -99,14 +99,9 @@ if(XRT_INSTALL_SYSTEMD_UNIT_FILES OR XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES)
endif()
if(XRT_HAVE_SDL2)
target_link_libraries(
monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl
)
target_link_libraries(monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl)
if(XRT_BUILD_DRIVER_QWERTY)
target_link_libraries(
monado-service PRIVATE drv_qwerty_includes
)
target_link_libraries(monado-service PRIVATE drv_qwerty_includes)
endif()
endif()

View file

@ -1,52 +1,31 @@
# Copyright 2019-2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# Mercury hand tracking library!
add_subdirectory(kine_lm)
add_subdirectory(kine_ccdik)
add_library(
t_ht_mercury_model STATIC
hg_model.cpp
)
add_library(t_ht_mercury_model STATIC hg_model.cpp)
target_link_libraries(t_ht_mercury_model PRIVATE aux_math aux_tracking aux_os aux_util)
target_link_libraries(
t_ht_mercury_model
PRIVATE
aux_math
aux_tracking
aux_os
aux_util
)
target_include_directories(t_ht_mercury_model
SYSTEM PRIVATE
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
target_include_directories(
t_ht_mercury_model SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}
)
target_link_libraries(
t_ht_mercury_model
t_ht_mercury_model
PRIVATE
aux_math
aux_tracking
aux_os
aux_util
aux_util
${OpenCV_LIBRARIES}
ONNXRuntime::ONNXRuntime
)
add_library(
t_ht_mercury STATIC
hg_sync.cpp
hg_sync.hpp
hg_interface.h
kine_common.hpp
)
add_library(t_ht_mercury STATIC hg_sync.cpp hg_sync.hpp hg_interface.h kine_common.hpp)
target_link_libraries(
t_ht_mercury
@ -65,16 +44,15 @@ target_link_libraries(
)
if(XRT_HAVE_OPENCV)
target_include_directories(t_ht_mercury SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
target_include_directories(
t_ht_mercury SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}
)
target_link_libraries(t_ht_mercury PUBLIC ${OpenCV_LIBRARIES})
endif()
# Below is entirely just so that tests can find us.
add_library(
t_ht_mercury_includes INTERFACE
)
add_library(t_ht_mercury_includes INTERFACE)
target_include_directories(
t_ht_mercury_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
)
)

View file

@ -1,20 +1,8 @@
# Copyright 2022, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
add_library(
t_ht_mercury_kine_ccdik STATIC
ccdik_interface.hpp
ccdik_main.cpp
)
add_library(t_ht_mercury_kine_ccdik STATIC ccdik_interface.hpp ccdik_main.cpp)
target_link_libraries(
t_ht_mercury_kine_ccdik
PRIVATE
aux_math
aux_tracking
aux_os
aux_util
)
target_link_libraries(t_ht_mercury_kine_ccdik PRIVATE aux_math aux_tracking aux_os aux_util)
target_include_directories(t_ht_mercury_kine_ccdik SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})

View file

@ -4,14 +4,14 @@
add_library(t_ht_mercury_kine_lm STATIC lm_interface.hpp lm_main.cpp)
target_link_libraries(
t_ht_mercury_kine_lm
t_ht_mercury_kine_lm
PRIVATE
aux_math
aux_tracking
aux_os
aux_util
xrt-external-tinyceres
)
)
target_include_directories(t_ht_mercury_kine_lm SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
@ -19,12 +19,10 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_options(t_ht_mercury_kine_lm PRIVATE -ftemplate-backtrace-limit=20)
endif()
# Below is entirely just so that tests can find us.
add_library(
t_ht_mercury_kine_lm_includes INTERFACE
)
add_library(t_ht_mercury_kine_lm_includes INTERFACE)
target_include_directories(
t_ht_mercury_kine_lm_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
)
t_ht_mercury_kine_lm_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)

View file

@ -10,22 +10,22 @@ if(ANDROID)
endif()
set(tests
tests_cxx_wrappers
tests_deque
tests_generic_callbacks
tests_history_buf
tests_id_ringbuffer
tests_input_transform
tests_json
tests_lowpass_float
tests_lowpass_integer
tests_pacing
tests_quatexpmap
tests_quat_change_of_basis
tests_rational
tests_vector
tests_worker
tests_pose
tests_cxx_wrappers
tests_deque
tests_generic_callbacks
tests_history_buf
tests_id_ringbuffer
tests_input_transform
tests_json
tests_lowpass_float
tests_lowpass_integer
tests_pacing
tests_quatexpmap
tests_quat_change_of_basis
tests_rational
tests_vector
tests_worker
tests_pose
)
if(XRT_HAVE_D3D11)
list(APPEND tests tests_aux_d3d_d3d11 tests_comp_client_d3d11)
@ -69,7 +69,6 @@ target_link_libraries(tests_quat_change_of_basis PRIVATE aux_math)
target_include_directories(tests_quat_change_of_basis SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
if(XRT_BUILD_DRIVER_HANDTRACKING)
target_link_libraries(
tests_levenbergmarquardt