Merge branch 'release/1.0.x' into merge_release_into_develop
This commit is contained in:
Коммит
b2138f7344
|
@ -32,3 +32,6 @@
|
|||
[submodule "extern/libjpeg-turbo/src"]
|
||||
path = extern/libjpeg-turbo/src
|
||||
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
|
||||
[submodule "extern/libusb/src"]
|
||||
path = extern/libusb/src
|
||||
url = https://github.com/libusb/libusb
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
# FindLibUSB.cmake
|
||||
#
|
||||
# Cross platform module to find the libusb library
|
||||
#
|
||||
# This will define the following variables
|
||||
#
|
||||
# LibUSB_FOUND
|
||||
#
|
||||
# and the following imported targets
|
||||
#
|
||||
# LibUSB::LibUSB
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
|
||||
set(LIBUSB_PREBUILT_WIN_LIB_URL https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z)
|
||||
get_filename_component(LIBUSB_7ZIP_FILENAME ${LIBUSB_PREBUILT_WIN_LIB_URL} NAME)
|
||||
set(LIBUSB_7ZIP ${CMAKE_CURRENT_BINARY_DIR}/${LIBUSB_7ZIP_FILENAME})
|
||||
|
||||
# For Windows builds, download pre-built libusb libraries
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
libusb_prebuilt_win_lib
|
||||
URL ${LIBUSB_PREBUILT_WIN_LIB_URL}
|
||||
URL_HASH MD5=750E64B45ACA94FAFBDFF07171004D03
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(libusb_prebuilt_win_lib)
|
||||
if (NOT libusb_prebuilt_win_lib_POPULATED)
|
||||
FetchContent_Populate(
|
||||
libusb_prebuilt_win_lib
|
||||
)
|
||||
endif()
|
||||
|
||||
# Check for path to include directory
|
||||
find_path(LIBUSB_INCLUDE_DIR
|
||||
NAMES
|
||||
libusb.h
|
||||
PATHS
|
||||
${libusb_prebuilt_win_lib_SOURCE_DIR}/include
|
||||
PATH_SUFFIXES
|
||||
libusb-1.0
|
||||
)
|
||||
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
|
||||
set(LIBUSB_LIB_PATH "${libusb_prebuilt_win_lib_SOURCE_DIR}/MS32/dll")
|
||||
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
set(LIBUSB_LIB_PATH "${libusb_prebuilt_win_lib_SOURCE_DIR}/MS64/dll")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported size of void ptr: ${CMAKE_SIZEOF_VOID_P}")
|
||||
endif()
|
||||
|
||||
find_library(LIBUSB_LIB
|
||||
NAMES
|
||||
libusb-1.0
|
||||
PATHS
|
||||
${LIBUSB_LIB_PATH}
|
||||
)
|
||||
|
||||
if ("${LIBUSB_LIB}" STREQUAL "LIBUSB_LIB-NOTFOUND")
|
||||
message(FATAL_ERROR "LibUSB not found")
|
||||
endif()
|
||||
|
||||
else()
|
||||
# For linux builds, find installed libusb libraries
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PC_LibUSB REQUIRED "libusb-1.0")
|
||||
|
||||
find_path(LIBUSB_INCLUDE_DIR
|
||||
NAMES
|
||||
libusb.h
|
||||
HINTS
|
||||
${PC_LibUSB_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
libusb-1.0
|
||||
)
|
||||
|
||||
find_library(LIBUSB_LIB
|
||||
NAMES
|
||||
${PC_LibUSB_LIBRARIES}
|
||||
HINTS
|
||||
${PC_LibUSB_LIBDIR}
|
||||
${PC_LibUSB_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBUSB_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBUSB_LIB)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibUSB DEFAULT_MSG LIBUSB_INCLUDE_DIR LIBUSB_LIB)
|
||||
|
||||
if (LibUSB_FOUND AND NOT TARGET LibUSB::LibUSB)
|
||||
add_library(LibUSB::LibUSB SHARED IMPORTED)
|
||||
|
||||
# On Windows copy the libUSB dll to the bin directory
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
# Use REGEX instead of NAME_WE since LibUsb-1.0.lib considers the extension "0.lib"
|
||||
string(REGEX REPLACE "^.*/([^/]*)\\.lib$" "\\1" LibUSB_NAME ${LIBUSB_LIB})
|
||||
get_filename_component(LibUSB_DIRECTORY ${LIBUSB_LIB} DIRECTORY)
|
||||
set(LibUSB_SHARED_PATH ${LibUSB_DIRECTORY}/${LibUSB_NAME}.dll)
|
||||
else(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(LibUSB_SHARED_PATH ${LIBUSB_LIB})
|
||||
endif()
|
||||
|
||||
|
||||
set_target_properties(LibUSB::LibUSB PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBUSB_INCLUDE_DIR}"
|
||||
IMPORTED_IMPLIB "${LIBUSB_LIB}"
|
||||
IMPORTED_LOCATION "${LibUSB_SHARED_PATH}")
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
include(CopyImportedBinary)
|
||||
copy_imported_binary(TARGET LibUSB::LibUSB)
|
||||
endif()
|
||||
endif()
|
|
@ -1,12 +1,45 @@
|
|||
find_package(LibUSB REQUIRED)
|
||||
add_library(LibUSB
|
||||
STATIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/core.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/descriptor.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/hotplug.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/io.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/strerror.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/sync.c")
|
||||
|
||||
target_include_directories(LibUSB PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/libusb)
|
||||
target_include_directories(LibUSB PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os)
|
||||
|
||||
add_library(LibUSB::LibUSB ALIAS LibUSB)
|
||||
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
target_compile_options(LibUSB PUBLIC "-Wno-zero-length-array")
|
||||
endif()
|
||||
|
||||
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
# Setup install
|
||||
include(GNUInstallDirs)
|
||||
install(
|
||||
FILES
|
||||
$<TARGET_FILE:LibUSB::LibUSB>
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
endif()
|
||||
target_sources(LibUSB PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/poll_windows.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/threads_windows.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/windows_nt_common.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/windows_usbdk.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/windows_winusb.c")
|
||||
|
||||
target_include_directories(LibUSB PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/msvc)
|
||||
|
||||
target_compile_definitions(LibUSB PRIVATE "_LIB" "_CRT_SECURE_NO_WARNINGS" "WINVER=0x0501" "_WIN32_WINNT=0x0501")
|
||||
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
target_sources(LibUSB PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/poll_posix.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/threads_posix.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/linux_usbfs.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/libusb/os/linux_udev.c")
|
||||
|
||||
target_include_directories(LibUSB PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/)
|
||||
|
||||
target_link_libraries(LibUSB PUBLIC "udev")
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
/* config.h. THIS WAS GENERATED FROM configure and autoheader and modified to be used in Linux builds */
|
||||
|
||||
/* config.h. Generated from config.h.in by configure. */
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Default visibility */
|
||||
#define DEFAULT_VISIBILITY __attribute__((visibility("default")))
|
||||
|
||||
/* Start with debug message logging enabled */
|
||||
/* #undef ENABLE_DEBUG_LOGGING */
|
||||
|
||||
/* Message logging */
|
||||
#define ENABLE_LOGGING 1
|
||||
|
||||
/* Define to 1 if you have the <asm/types.h> header file. */
|
||||
/* #undef HAVE_ASM_TYPES_H */
|
||||
|
||||
/* Define to 1 if you have the declaration of `TFD_CLOEXEC', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_TFD_CLOEXEC 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `TFD_NONBLOCK', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_TFD_NONBLOCK 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `udev' library (-ludev). */
|
||||
#define HAVE_LIBUDEV 1
|
||||
|
||||
/* Define to 1 if you have the <libudev.h> header file. */
|
||||
#define HAVE_LIBUDEV_H 1
|
||||
|
||||
/* Define to 1 if you have the <linux/netlink.h> header file. */
|
||||
/* #undef HAVE_LINUX_NETLINK_H */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `pipe2' function. */
|
||||
#define HAVE_PIPE2 1
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
#define HAVE_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `struct timespec'. */
|
||||
#define HAVE_STRUCT_TIMESPEC 1
|
||||
|
||||
/* syslog() function available */
|
||||
/* #undef HAVE_SYSLOG_FUNC */
|
||||
|
||||
/* Define to 1 if you have the <syslog.h> header file. */
|
||||
/* #undef HAVE_SYSLOG_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
/* #undef HAVE_SYS_SOCKET_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Darwin backend */
|
||||
/* #undef OS_DARWIN */
|
||||
|
||||
/* Haiku backend */
|
||||
/* #undef OS_HAIKU */
|
||||
|
||||
/* Linux backend */
|
||||
#define OS_LINUX 1
|
||||
|
||||
/* NetBSD backend */
|
||||
/* #undef OS_NETBSD */
|
||||
|
||||
/* OpenBSD backend */
|
||||
/* #undef OS_OPENBSD */
|
||||
|
||||
/* SunOS backend */
|
||||
/* #undef OS_SUNOS */
|
||||
|
||||
/* Windows backend */
|
||||
/* #undef OS_WINDOWS */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libusb"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "libusb-devel@lists.sourceforge.net"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "libusb"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "libusb 1.0.22"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "libusb"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "http://libusb.info"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.0.22"
|
||||
|
||||
/* type of second poll() argument */
|
||||
#define POLL_NFDS_TYPE nfds_t
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Use POSIX Threads */
|
||||
#define THREADS_POSIX 1
|
||||
|
||||
/* timerfd headers available */
|
||||
#define USBI_TIMERFD_AVAILABLE 1
|
||||
|
||||
/* Enable output to system log */
|
||||
/* #undef USE_SYSTEM_LOGGING_FACILITY */
|
||||
|
||||
/* Use udev for device enumeration/hotplug */
|
||||
#define USE_UDEV 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.0.22"
|
||||
|
||||
/* Oldest Windows version supported */
|
||||
/* #undef WINVER */
|
||||
|
||||
/* Oldest Windows version supported */
|
||||
/* #undef _WIN32_WINNT */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
/* #undef inline */
|
||||
#endif
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0034b2afdcdb1614e78edaa2a9e22d5936aeae5d
|
|
@ -1,7 +1,5 @@
|
|||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
if (NOT TARGET project_libuvc)
|
||||
find_package(LibUSB REQUIRED)
|
||||
|
||||
set(CMAKE_BUILD_TARGET Static)
|
||||
|
||||
include(ExternalProject)
|
||||
|
|
|
@ -32,5 +32,6 @@ sudo apt install -y \
|
|||
libxrandr-dev \
|
||||
libusb-1.0-0-dev \
|
||||
libssl-dev \
|
||||
libudev-dev \
|
||||
mesa-common-dev \
|
||||
uuid-dev
|
||||
|
|
|
@ -7,13 +7,11 @@ add_library(k4a_usb_cmd STATIC
|
|||
)
|
||||
|
||||
# Consumers should #include <k4ainternal/usbcommand.h>
|
||||
target_include_directories(k4a_usb_cmd PUBLIC
|
||||
target_include_directories(k4a_usb_cmd PUBLIC
|
||||
${K4A_PRIV_INCLUDE_DIR})
|
||||
|
||||
find_package(LibUSB REQUIRED)
|
||||
|
||||
# Dependencies of this library
|
||||
target_link_libraries(k4a_usb_cmd PUBLIC
|
||||
target_link_libraries(k4a_usb_cmd PUBLIC
|
||||
azure::aziotsharedutil
|
||||
LibUSB::LibUSB
|
||||
k4ainternal::allocator
|
||||
|
|
|
@ -48,7 +48,6 @@ configure_file(
|
|||
)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(LibUSB REQUIRED)
|
||||
include_directories(
|
||||
${OPENGL_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
|
|
Загрузка…
Ссылка в новой задаче