From fd33a2a9e3181cc55ab1e7872a3a843095baf6e7 Mon Sep 17 00:00:00 2001
From: Ryan Pavlik <ryan.pavlik@collabora.com>
Date: Wed, 19 Jun 2019 12:39:06 -0500
Subject: [PATCH] build: Adjust montrack build.

Prober build now works on Buster, but not on Arch container.
---
 src/xrt/targets/CMakeLists.txt        | 39 ++++++++++++++++++++++++-
 src/xrt/targets/openxr/CMakeLists.txt | 42 ---------------------------
 2 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/src/xrt/targets/CMakeLists.txt b/src/xrt/targets/CMakeLists.txt
index c65842fce..872b44dd8 100644
--- a/src/xrt/targets/CMakeLists.txt
+++ b/src/xrt/targets/CMakeLists.txt
@@ -29,6 +29,43 @@ if(BUILD_DRIVER_PSVR)
 	list(APPEND DRIVER_LIBRARIES ${HIDAPI_LIBRARIES})
 endif()
 
+if(BUILD_DRIVER_MONTRACK)
+	list(APPEND DRIVER_OBJECTS
+		$<TARGET_OBJECTS:drv_montrack>
+		$<TARGET_OBJECTS:frameserver>
+		$<TARGET_OBJECTS:filter>
+		$<TARGET_OBJECTS:optical_tracking>)
+	if(BUILD_WITH_LIBUVC AND BUILD_WITH_JPEG)
+		list(APPEND DRIVER_LIBRARIES
+			${libuvc_LIBRARIES}
+			${LIBUSB1_LIBRARIES})
+	endif()
+	if(BUILD_WITH_JPEG)
+		list(APPEND DRIVER_LIBRARIES
+			${JPEG_LIBRARIES})
+	endif()
+	if(BUILD_WITH_FFMPEG)
+		list(APPEND DRIVER_LIBRARIES
+			avformat # TODO find rather than hard code!
+			avcodec # TODO find rather than hard code!
+			avutil # TODO find rather than hard code!
+		)
+	endif()
+	if(BUILD_WITH_UVBI)
+		list(APPEND DRIVER_LIBRARIES
+			uvbi::uvbi_plugin_parts)
+	endif()
+	list(APPEND DRIVER_LIBRARIES
+		opencv_core
+		opencv_calib3d
+		opencv_highgui
+		opencv_imgproc
+		opencv_imgcodecs
+		opencv_features2d
+		opencv_video
+		)
+endif()
+
 add_subdirectory(common)
 add_subdirectory(openxr)
-#add_subdirectory(prober)
+# add_subdirectory(prober)
diff --git a/src/xrt/targets/openxr/CMakeLists.txt b/src/xrt/targets/openxr/CMakeLists.txt
index 675941b9c..cc9892f49 100644
--- a/src/xrt/targets/openxr/CMakeLists.txt
+++ b/src/xrt/targets/openxr/CMakeLists.txt
@@ -89,48 +89,6 @@ if(DRIVER_LIBRARIES)
 	target_link_libraries(${RUNTIME_TARGET} PRIVATE ${DRIVER_LIBRARIES})
 endif()
 
-if(BUILD_DRIVER_MONTRACK)
-	target_sources(${RUNTIME_TARGET} PRIVATE
-		$<TARGET_OBJECTS:drv_montrack>
-		$<TARGET_OBJECTS:frameserver>
-		$<TARGET_OBJECTS:filter>
-		$<TARGET_OBJECTS:optical_tracking>)
-	if(BUILD_WITH_LIBUVC AND BUILD_WITH_JPEG)
-		target_link_libraries(${RUNTIME_TARGET}
-			PUBLIC
-			${libuvc_LIBRARIES}
-			${LIBUSB1_LIBRARIES})
-	endif()
-	if(BUILD_WITH_JPEG)
-		target_link_libraries(${RUNTIME_TARGET}
-			PUBLIC
-			${JPEG_LIBRARIES})
-	endif()
-	if(BUILD_WITH_FFMPEG)
-		target_link_libraries(${RUNTIME_TARGET}
-			PUBLIC
-			avformat # TODO find rather than hard code!
-			avcodec # TODO find rather than hard code!
-			avutil # TODO find rather than hard code!
-		)
-	endif()
-	if(BUILD_WITH_UVBI)
-		target_link_libraries(${RUNTIME_TARGET}
-			PUBLIC
-			uvbi::uvbi_plugin_parts)
-	endif()
-	target_link_libraries(${RUNTIME_TARGET}
-		PUBLIC
-		jpeg # TODO find rather than hard code!
-		opencv_core
-		opencv_calib3d
-		opencv_highgui
-		opencv_imgproc
-		opencv_imgcodecs
-		opencv_features2d
-		opencv_video
-		)
-endif()
 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
 	include(GNUInstallDirs)
 	install(TARGETS ${RUNTIME_TARGET}
-- 
GitLab