summarylogtreecommitdiffstats
path: root/01-use-system-libraries.patch
blob: a657153ad129c4efabf0ac49926743b3e277a385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff --color --unified --recursive --text inertial-sense-sdk.orig/cltool/CMakeLists.txt inertial-sense-sdk.new/cltool/CMakeLists.txt
--- inertial-sense-sdk.orig/cltool/CMakeLists.txt	2024-03-01 11:57:23.474148235 +0100
+++ inertial-sense-sdk.new/cltool/CMakeLists.txt	2024-03-01 11:08:58.719165839 +0100
@@ -16,7 +16,7 @@
 # Include InertialSenseSDK header files
 include_directories(
     ${IS_SDK_DIR}/src
-    ${IS_SDK_DIR}/src/libusb/libusb
+    /usr/include/libusb-1.0/
 )
 
 # Link the InertialSenseSDK static library 
diff --color --unified --recursive --text inertial-sense-sdk.orig/CMakeLists.txt inertial-sense-sdk.new/CMakeLists.txt
--- inertial-sense-sdk.orig/CMakeLists.txt	2024-03-01 11:57:23.474148235 +0100
+++ inertial-sense-sdk.new/CMakeLists.txt	2024-03-01 12:00:25.756010207 +0100
@@ -2,6 +2,8 @@
 
 project(InertialSenseSDK)
 
+find_package(yaml-cpp REQUIRED)
+
 file(GLOB SOURCES_SDK
 	"src/*.c"
 	"src/*.cpp"
@@ -11,30 +13,8 @@
     "src/util/*.cpp"
     "src/util/*.h"
 	"hw-libs/bootloader/bootloaderShared.c"
-	"src/yaml-cpp/*.cpp"
-	"src/yaml-cpp/*.h"
-	"src/yaml-cpp/contrib/*.cpp"
-	"src/yaml-cpp/contrib/*.h"
-	"src/yaml-cpp/node/*.cpp"
-	"src/yaml-cpp/node/*.h"
 )
 
-# Compile libusb from source
-if(WIN32)
-	file(GLOB SOURCES_LIB_USB
-		"src/libusb/libusb/*.h"
-		"src/libusb/libusb/*.c"
-		"src/libusb/libusb/os/*windows*"
-	)
-else()
-	file(GLOB SOURCES_LIB_USB
-		"src/libusb/libusb/*.h"
-		"src/libusb/libusb/*.c"
-		"src/libusb/libusb/os/*linux*"
-		"src/libusb/libusb/os/*posix*"
-	)
-endif()
-
 # Ignore bootloader files
 # list(FILTER SOURCES_SDK EXCLUDE REGEX "ISBootloader.*")
 list(FILTER SOURCES_SDK EXCLUDE REGEX "ISBootloaderSony.*")
@@ -49,9 +29,7 @@
 	src
 	src/util
 	src/protocol
-	src/libusb
-	src/libusb/libusb
-	src/yaml-cpp
+   /usr/include/libusb-1.0/
 	external
 )
 
@@ -72,11 +50,6 @@
 	# We need to ensure windows static libs are found
 	target_link_libraries(${PROJECT_NAME} Ws2_32.lib)
 else()
-	# Linux specific include dir 
-	target_include_directories(${PROJECT_NAME} PUBLIC
-		${CMAKE_CURRENT_LIST_DIR}/src/libusb/linux
-	)
-	
 	# Linux compiler flags
 	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers")
 	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers")
@@ -85,5 +58,5 @@
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
 	
 	# Link in Linux specific packages
-	target_link_libraries(${PROJECT_NAME} udev m)
+	target_link_libraries(${PROJECT_NAME} udev m usb-1.0 yaml-cpp)
 endif()