From d2e2c3a988cd706ceb20c9824104bd7c969b268a Mon Sep 17 00:00:00 2001 From: Moses Turner Date: Mon, 19 Sep 2022 13:50:32 -0500 Subject: [PATCH] cmake: Run cmake-format.sh --- src/external/CMakeLists.txt | 4 +- src/xrt/auxiliary/CMakeLists.txt | 6 ++- src/xrt/auxiliary/android/CMakeLists.txt | 5 +- src/xrt/auxiliary/gstreamer/CMakeLists.txt | 1 - src/xrt/auxiliary/math/CMakeLists.txt | 1 - src/xrt/auxiliary/os/CMakeLists.txt | 1 - src/xrt/auxiliary/tracking/CMakeLists.txt | 1 - src/xrt/auxiliary/vive/CMakeLists.txt | 8 +-- src/xrt/compositor/CMakeLists.txt | 28 +++++------ src/xrt/compositor/null/CMakeLists.txt | 11 +++- src/xrt/drivers/CMakeLists.txt | 50 +++++++++++-------- src/xrt/targets/CMakeLists.txt | 5 +- src/xrt/targets/common/CMakeLists.txt | 8 ++- src/xrt/targets/service/CMakeLists.txt | 9 +--- src/xrt/tracking/hand/mercury/CMakeLists.txt | 46 +++++------------ .../hand/mercury/kine_ccdik/CMakeLists.txt | 16 +----- .../hand/mercury/kine_lm/CMakeLists.txt | 14 +++--- tests/CMakeLists.txt | 33 ++++++------ 18 files changed, 106 insertions(+), 141 deletions(-) diff --git a/src/external/CMakeLists.txt b/src/external/CMakeLists.txt index 676c63fcc..5b4f06ce5 100644 --- a/src/external/CMakeLists.txt +++ b/src/external/CMakeLists.txt @@ -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 + ) diff --git a/src/xrt/auxiliary/CMakeLists.txt b/src/xrt/auxiliary/CMakeLists.txt index b408ee1f7..e32e789ec 100644 --- a/src/xrt/auxiliary/CMakeLists.txt +++ b/src/xrt/auxiliary/CMakeLists.txt @@ -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() diff --git a/src/xrt/auxiliary/android/CMakeLists.txt b/src/xrt/auxiliary/android/CMakeLists.txt index 6ecb984a5..fa83843b2 100644 --- a/src/xrt/auxiliary/android/CMakeLists.txt +++ b/src/xrt/auxiliary/android/CMakeLists.txt @@ -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) diff --git a/src/xrt/auxiliary/gstreamer/CMakeLists.txt b/src/xrt/auxiliary/gstreamer/CMakeLists.txt index 962cdfa62..4f7ebcbb2 100644 --- a/src/xrt/auxiliary/gstreamer/CMakeLists.txt +++ b/src/xrt/auxiliary/gstreamer/CMakeLists.txt @@ -1,7 +1,6 @@ # Copyright 2019-2022, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 - add_library( aux_gstreamer STATIC gst_internal.h diff --git a/src/xrt/auxiliary/math/CMakeLists.txt b/src/xrt/auxiliary/math/CMakeLists.txt index 3bc14c7c2..aaa1bba8b 100644 --- a/src/xrt/auxiliary/math/CMakeLists.txt +++ b/src/xrt/auxiliary/math/CMakeLists.txt @@ -1,7 +1,6 @@ # Copyright 2019-2022, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 - add_library( aux_math STATIC m_api.h diff --git a/src/xrt/auxiliary/os/CMakeLists.txt b/src/xrt/auxiliary/os/CMakeLists.txt index ad972350b..9405c2047 100644 --- a/src/xrt/auxiliary/os/CMakeLists.txt +++ b/src/xrt/auxiliary/os/CMakeLists.txt @@ -1,7 +1,6 @@ # Copyright 2019-2022, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 - add_library( aux_os STATIC os_ble.h diff --git a/src/xrt/auxiliary/tracking/CMakeLists.txt b/src/xrt/auxiliary/tracking/CMakeLists.txt index ab8a53187..0cb9d4a7f 100644 --- a/src/xrt/auxiliary/tracking/CMakeLists.txt +++ b/src/xrt/auxiliary/tracking/CMakeLists.txt @@ -1,7 +1,6 @@ # Copyright 2019-2022, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 - add_library( aux_tracking STATIC t_data_utils.c diff --git a/src/xrt/auxiliary/vive/CMakeLists.txt b/src/xrt/auxiliary/vive/CMakeLists.txt index 9c1197a91..5bd4661fc 100644 --- a/src/xrt/auxiliary/vive/CMakeLists.txt +++ b/src/xrt/auxiliary/vive/CMakeLists.txt @@ -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 diff --git a/src/xrt/compositor/CMakeLists.txt b/src/xrt/compositor/CMakeLists.txt index 46faef489..5c81f1cdb 100644 --- a/src/xrt/compositor/CMakeLists.txt +++ b/src/xrt/compositor/CMakeLists.txt @@ -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( diff --git a/src/xrt/compositor/null/CMakeLists.txt b/src/xrt/compositor/null/CMakeLists.txt index a8acb5705..978270b3d 100644 --- a/src/xrt/compositor/null/CMakeLists.txt +++ b/src/xrt/compositor/null/CMakeLists.txt @@ -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}/..) diff --git a/src/xrt/drivers/CMakeLists.txt b/src/xrt/drivers/CMakeLists.txt index 5e664ebdd..fa70329cb 100644 --- a/src/xrt/drivers/CMakeLists.txt +++ b/src/xrt/drivers/CMakeLists.txt @@ -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. diff --git a/src/xrt/targets/CMakeLists.txt b/src/xrt/targets/CMakeLists.txt index 5bbdda486..af543503d 100644 --- a/src/xrt/targets/CMakeLists.txt +++ b/src/xrt/targets/CMakeLists.txt @@ -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() diff --git a/src/xrt/targets/common/CMakeLists.txt b/src/xrt/targets/common/CMakeLists.txt index e60a09ee0..11b345612 100644 --- a/src/xrt/targets/common/CMakeLists.txt +++ b/src/xrt/targets/common/CMakeLists.txt @@ -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 diff --git a/src/xrt/targets/service/CMakeLists.txt b/src/xrt/targets/service/CMakeLists.txt index 94ecec884..c244febcb 100644 --- a/src/xrt/targets/service/CMakeLists.txt +++ b/src/xrt/targets/service/CMakeLists.txt @@ -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() - diff --git a/src/xrt/tracking/hand/mercury/CMakeLists.txt b/src/xrt/tracking/hand/mercury/CMakeLists.txt index 916248fb4..ca13fce4d 100644 --- a/src/xrt/tracking/hand/mercury/CMakeLists.txt +++ b/src/xrt/tracking/hand/mercury/CMakeLists.txt @@ -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} -) \ No newline at end of file + ) diff --git a/src/xrt/tracking/hand/mercury/kine_ccdik/CMakeLists.txt b/src/xrt/tracking/hand/mercury/kine_ccdik/CMakeLists.txt index f54b7c692..dae6c6dc3 100644 --- a/src/xrt/tracking/hand/mercury/kine_ccdik/CMakeLists.txt +++ b/src/xrt/tracking/hand/mercury/kine_ccdik/CMakeLists.txt @@ -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}) diff --git a/src/xrt/tracking/hand/mercury/kine_lm/CMakeLists.txt b/src/xrt/tracking/hand/mercury/kine_lm/CMakeLists.txt index 1326efa55..1c2a0d5f4 100644 --- a/src/xrt/tracking/hand/mercury/kine_lm/CMakeLists.txt +++ b/src/xrt/tracking/hand/mercury/kine_lm/CMakeLists.txt @@ -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} -) \ No newline at end of file + t_ht_mercury_kine_lm_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index be7419de3..572b57448 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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