xrt: Let BUILD_TRACKING mean you need more than just the IMU fusion.

This is required to build anything that uses the IMU fusion module
without OpenCV.
This commit is contained in:
Ryan Pavlik 2019-12-03 15:48:36 -06:00
parent 2f5da6cf8a
commit 47f704277a
4 changed files with 53 additions and 43 deletions

View file

@ -25,25 +25,30 @@ set(OS_SOURCE_FILES
)
set(TRACKING_SOURCE_FILES
tracking/t_calibration.cpp
tracking/t_calibration_opencv.hpp
tracking/t_convert.cpp
tracking/t_debug_hsv_filter.cpp
tracking/t_debug_hsv_picker.cpp
tracking/t_debug_hsv_viewer.cpp
tracking/t_file.cpp
tracking/t_fusion.hpp
tracking/t_hsv_filter.c
tracking/t_imu.h
tracking/t_imu_fusion.hpp
tracking/t_kalman.cpp
tracking/t_lowpass.hpp
tracking/t_imu.cpp
tracking/t_imu.h
tracking/t_lowpass_vector.hpp
tracking/t_tracker_psmv.cpp
tracking/t_tracker_psmv_fusion.hpp
tracking/t_tracker_psvr.cpp
tracking/t_lowpass.hpp
tracking/t_tracking.h
)
if(BUILD_TRACKING)
list(APPEND TRACKING_SOURCE_FILES
tracking/t_calibration_opencv.hpp
tracking/t_calibration.cpp
tracking/t_convert.cpp
tracking/t_debug_hsv_filter.cpp
tracking/t_debug_hsv_picker.cpp
tracking/t_debug_hsv_viewer.cpp
tracking/t_file.cpp
tracking/t_fusion.hpp
tracking/t_hsv_filter.c
tracking/t_kalman.cpp
tracking/t_tracker_psmv_fusion.hpp
tracking/t_tracker_psmv.cpp
tracking/t_tracker_psvr.cpp
)
endif()
set(UTIL_SOURCE_FILES
util/u_misc.c
@ -109,17 +114,19 @@ target_include_directories(aux_math SYSTEM
PRIVATE ${EIGEN3_INCLUDE_DIR}
)
# Tracking library.
# Use OBJECT to not create a archive, since it just gets in the way.
add_library(aux_tracking OBJECT ${TRACKING_SOURCE_FILES})
# Tracking files have extra includes.
target_include_directories(aux_tracking SYSTEM
PRIVATE
${EIGEN3_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../../external
)
if(BUILD_TRACKING)
# Tracking library.
# Use OBJECT to not create a archive, since it just gets in the way.
add_library(aux_tracking OBJECT ${TRACKING_SOURCE_FILES})
# Tracking files have extra includes.
target_include_directories(aux_tracking SYSTEM
PRIVATE
${EIGEN3_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/../../external
)
endif()

View file

@ -101,32 +101,39 @@ aux_math = declare_dependency(
)
tracking_srcs = [
'tracking/t_calibration.cpp',
'tracking/t_calibration_opencv.hpp',
'tracking/t_convert.cpp',
'tracking/t_debug_hsv_filter.cpp',
'tracking/t_debug_hsv_picker.cpp',
'tracking/t_debug_hsv_viewer.cpp',
'tracking/t_file.cpp',
'tracking/t_fusion.hpp',
'tracking/t_hsv_filter.c',
'tracking/t_imu.h',
'tracking/t_imu_fusion.hpp',
'tracking/t_kalman.cpp',
'tracking/t_imu.cpp',
'tracking/t_lowpass.hpp',
'tracking/t_lowpass_vector.hpp',
'tracking/t_tracker_psmv.cpp',
'tracking/t_tracker_psmv_fusion.hpp',
'tracking/t_tracker_psvr.cpp',
'tracking/t_tracking.h',
]
tracking_deps = [eigen3]
if build_tracking
tracking_srcs += [
'tracking/t_calibration.cpp',
'tracking/t_calibration_opencv.hpp',
'tracking/t_convert.cpp',
'tracking/t_debug_hsv_filter.cpp',
'tracking/t_debug_hsv_picker.cpp',
'tracking/t_debug_hsv_viewer.cpp',
'tracking/t_file.cpp',
'tracking/t_fusion.hpp',
'tracking/t_hsv_filter.c',
'tracking/t_kalman.cpp',
'tracking/t_tracker_psmv.cpp',
'tracking/t_tracker_psmv_fusion.hpp',
'tracking/t_tracker_psvr.cpp',
]
tracking_deps += [opencv]
endif
lib_aux_tracking = static_library(
'aux_tracking',
files(tracking_srcs),
include_directories: [xrt_include, external_include],
dependencies: [eigen3, opencv],
build_by_default: build_tracking,
dependencies: tracking_deps
)
aux_tracking = declare_dependency(
@ -134,9 +141,6 @@ aux_tracking = declare_dependency(
link_with: lib_aux_tracking,
)
all_aux = [aux_util, aux_os, aux_math]
if build_tracking
all_aux += [aux_tracking]
endif
all_aux = [aux_util, aux_os, aux_math, aux_tracking]
aux = declare_dependency(dependencies: all_aux)

View file

@ -9,5 +9,4 @@
* @ingroup aux_tracking
*/
#include "tracking/t_imu.cpp"
#include "tracking/t_tracker_psmv_fusion.cpp"

View file

@ -52,9 +52,9 @@ if(BUILD_DRIVER_VIVE)
list(APPEND DRIVER_LIBRARIES ${ZLIB_LIBRARIES})
endif()
list(APPEND DRIVER_OBJECTS $<TARGET_OBJECTS:aux_tracking>)
if(BUILD_TRACKING)
list(APPEND DRIVER_OBJECTS $<TARGET_OBJECTS:aux_tracking>)
list(APPEND DRIVER_LIBRARIES ${OpenCV_LIBRARIES})
endif()