aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/azure-kinect-sensor-sdk/fix-builds.patch
blob: a904cbbc06f007ca2391001af784aaabf7f4ba0c (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f002b5..dd9b1df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,8 +27,6 @@ option(K4A_BUILD_DOCS "Build K4A doxygen documentation" OFF)
 option(K4A_MTE_VERSION "Skip FW version check" OFF)
 option(K4A_SOURCE_LINK "Enable source linking on MSVC" OFF)
 
-include(GitCommands)
-
 # Set the project version
 include(K4AProjectVersion)
 
@@ -101,7 +99,59 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL
 endif()
 
 # Find all dependencies
-add_subdirectory(extern)
+find_package(azure_c_shared_utility CONFIG REQUIRED)
+add_library(azure::aziotsharedutil ALIAS aziotsharedutil)
+
+find_package(cJSON CONFIG REQUIRED)
+add_library(cJSON::cJSON ALIAS cjson)
+
+find_package(EBML CONFIG REQUIRED)
+add_library(ebml::ebml ALIAS EBML::ebml)
+
+find_package(libjpeg-turbo CONFIG REQUIRED)
+if(TARGET libjpeg-turbo::turbojpeg)
+    add_library(libjpeg-turbo::libjpeg-turbo ALIAS libjpeg-turbo::turbojpeg)
+else()
+    add_library(libjpeg-turbo::libjpeg-turbo ALIAS libjpeg-turbo::turbojpeg-static)
+endif()
+
+find_package(libsoundio CONFIG REQUIRED)
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
+add_library(LibUSB::LibUSB ALIAS PkgConfig::libusb)
+
+if(NOT WIN32)
+    find_package(libuvc CONFIG REQUIRED)
+    if(TARGET LibUVC::UVCShared)
+        add_library(libuvc::libuvc ALIAS LibUVC::UVCShared)
+    else()
+        add_library(libuvc::libuvc ALIAS LibUVC::UVCStatic)
+    endif()
+endif()
+
+find_package(libyuv CONFIG REQUIRED)
+add_library(libyuv::libyuv ALIAS yuv)
+
+find_package(Matroska CONFIG REQUIRED)
+add_library(matroska::matroska ALIAS Matroska::matroska)
+add_definitions(-DMATROSKA_VERSION=2)
+
+find_package(spdlog CONFIG REQUIRED)
+
+if (BUILD_TOOLS)
+    find_package(gl3w CONFIG REQUIRED)
+
+    find_package(glfw3 CONFIG REQUIRED)
+    add_library(glfw::glfw ALIAS glfw)
+
+    find_package(imgui CONFIG REQUIRED)
+endif()
+
+# Fix embl error
+if (MSVC)
+    add_compile_options(/wd4828 /wd4251 /wd4275)
+endif()
 
 # Don't enable testing until after building dependencies
 enable_testing()
@@ -161,10 +211,13 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
     endif()
 endif()
 
-add_subdirectory(examples)
-add_subdirectory(src)
-add_subdirectory(tests)
-add_subdirectory(tools)
+if (BUILD_EXAMPLES)
+ add_subdirectory(examples)
+endif()
+ add_subdirectory(src)
+if (BUILD_TOOLS)
+ add_subdirectory(tools)
+endif()
 
 if (K4A_BUILD_DOCS)
     find_package(Doxygen 1.8.14 EXACT)
diff --git a/src/calibration/calibration.c b/src/calibration/calibration.c
index bf5f34a..d37c4e6 100644
--- a/src/calibration/calibration.c
+++ b/src/calibration/calibration.c
@@ -6,7 +6,7 @@
 
 // Dependent libraries
 #include <k4ainternal/common.h>
-#include <cJSON.h>
+#include <cjson/cJSON.h>
 #include <locale.h> //cJSON.h need this set correctly.
 
 // System dependencies
diff --git a/src/logging/logging.cpp b/src/logging/logging.cpp
index 05264c5..41185de 100644
--- a/src/logging/logging.cpp
+++ b/src/logging/logging.cpp
@@ -24,6 +24,9 @@
 #pragma warning(disable : 4702)
 #endif
 #include <spdlog/spdlog.h>
+#include <spdlog/sinks/stdout_color_sinks.h>
+#include <spdlog/sinks/rotating_file_sink.h>
+#include <spdlog/sinks/stdout_sinks.h>
 #ifdef _MSC_VER
 #pragma warning(default : 4702)
 #endif
diff --git a/src/usbcommand/usb_cmd_priv.h b/src/usbcommand/usb_cmd_priv.h
index 0aa502c..0405b58 100644
--- a/src/usbcommand/usb_cmd_priv.h
+++ b/src/usbcommand/usb_cmd_priv.h
@@ -20,7 +20,7 @@
 #include <azure_c_shared_utility/threadapi.h>
 
 // Exteranl dependencis
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 
 // Ensure we have LIBUSB_API_VERSION defined if not defined by libusb.h
 #ifndef LIBUSB_API_VERSION
diff --git a/tools/k4aviewer/CMakeLists.txt b/tools/k4aviewer/CMakeLists.txt
index 98578c0..244c867 100644
--- a/tools/k4aviewer/CMakeLists.txt
+++ b/tools/k4aviewer/CMakeLists.txt
@@ -64,6 +64,7 @@ set(EXTERNAL_LIBRARIES
     libyuv::libyuv
     glfw::glfw
     ${OPENGL_LIBRARIES}
+    unofficial::gl3w::gl3w
 )
 
 # On Windows, we need to call into setupapi to get USB container ID information
diff --git a/tools/k4aviewer/k4aaudiomanager.cpp b/tools/k4aviewer/k4aaudiomanager.cpp
index 243c800..ef85d45 100644
--- a/tools/k4aviewer/k4aaudiomanager.cpp
+++ b/tools/k4aviewer/k4aaudiomanager.cpp
@@ -11,7 +11,7 @@
 
 // Library headers
 //
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 
 // Project headers
 //
diff --git a/tools/k4aviewer/k4asoundio_util.h b/tools/k4aviewer/k4asoundio_util.h
index c9c2718..011a76e 100644
--- a/tools/k4aviewer/k4asoundio_util.h
+++ b/tools/k4aviewer/k4asoundio_util.h
@@ -16,7 +16,7 @@
 // This disables that behavior.
 //
 #define NOMINMAX
-#include <soundio.h>
+#include <soundio/soundio.h>
 
 // Project headers
 //